Sha256: 6dd5a056a04e3dd0b7b414179ffab029041f89da2ed51f81cbd84d37181051dd

Contents?: true

Size: 983 Bytes

Versions: 7

Compression:

Stored size: 983 Bytes

Contents

module WhurlEngine
  class CategoriesController < WhurlEngine::ApplicationController
    def index
      @categories = WhurlEngine::Category.all.sort
    end

    def new
      @category = WhurlEngine::Category.new
    end

    def create
      @category = WhurlEngine::Category.new(params[:category])
      unless @category.save
        render :partial => 'whurl_engine/shared/error', :locals => {:object => @category}
      end
    end

    def edit
      @category = WhurlEngine::Category.find(params[:id])
    end

    def update
      @category = WhurlEngine::Category.find(params[:id])
      unless @category.update_attributes(params[:category])
        render :partial => 'whurl_engine/shared/error', :locals => {:object => @category}
      end
    end

    def destroy
      @category = WhurlEngine::Category.find(params[:id])
      unless @category.destroy
        render :partial => 'whurl_engine/shared/error', :locals => {:object => @category}
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
whurl_engine-2.2.0 app/controllers/whurl_engine/categories_controller.rb
whurl_engine-2.1.4 app/controllers/whurl_engine/categories_controller.rb
whurl_engine-2.1.3 app/controllers/whurl_engine/categories_controller.rb
whurl_engine-2.1.2 app/controllers/whurl_engine/categories_controller.rb
whurl_engine-2.1.0 app/controllers/whurl_engine/categories_controller.rb
whurl_engine-2.0.1 app/controllers/whurl_engine/categories_controller.rb
whurl_engine-2.0.0 app/controllers/whurl_engine/categories_controller.rb