Class: Shoppe::ProductCategoriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Shoppe::ProductCategoriesController
- Defined in:
- app/controllers/shoppe/product_categories_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/controllers/shoppe/product_categories_controller.rb', line 14 def create @product_category = Shoppe::ProductCategory.new(safe_params) if @product_category.save redirect_to :product_categories, :flash => {:notice => "Category has been created successfully"} else render :action => "new" end end |
#destroy ⇒ Object
34 35 36 37 |
# File 'app/controllers/shoppe/product_categories_controller.rb', line 34 def destroy @product_category.destroy redirect_to :product_categories, :flash => {:notice => "Category has been removed successfully"} end |
#edit ⇒ Object
23 24 |
# File 'app/controllers/shoppe/product_categories_controller.rb', line 23 def edit end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/shoppe/product_categories_controller.rb', line 6 def index @product_categories = Shoppe::ProductCategory.ordered.all end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/shoppe/product_categories_controller.rb', line 10 def new @product_category = Shoppe::ProductCategory.new end |
#update ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/controllers/shoppe/product_categories_controller.rb', line 26 def update if @product_category.update(safe_params) redirect_to [:edit, @product_category], :flash => {:notice => "Category has been updated successfully"} else render :action => "edit" end end |