Class: WhurlEngine::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- WhurlEngine::CategoriesController
- Defined in:
- app/controllers/whurl_engine/categories_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 |
# File 'app/controllers/whurl_engine/categories_controller.rb', line 11 def create @category = WhurlEngine::Category.new(params[:category]) unless @category.save render :partial => 'whurl_engine/shared/error', :locals => {:object => @category} end end |
#destroy ⇒ Object
29 30 31 32 33 34 |
# File 'app/controllers/whurl_engine/categories_controller.rb', line 29 def destroy @category = WhurlEngine::Category.find(params[:id]) unless @category.destroy render :partial => 'whurl_engine/shared/error', :locals => {:object => @category} end end |
#edit ⇒ Object
18 19 20 |
# File 'app/controllers/whurl_engine/categories_controller.rb', line 18 def edit @category = WhurlEngine::Category.find(params[:id]) end |
#index ⇒ Object
3 4 5 |
# File 'app/controllers/whurl_engine/categories_controller.rb', line 3 def index @categories = WhurlEngine::Category.all.sort end |
#new ⇒ Object
7 8 9 |
# File 'app/controllers/whurl_engine/categories_controller.rb', line 7 def new @category = WhurlEngine::Category.new end |
#update ⇒ Object
22 23 24 25 26 27 |
# File 'app/controllers/whurl_engine/categories_controller.rb', line 22 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 |