Class: KktShoppe::ProductCategoriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- KktShoppe::ProductCategoriesController
- Defined in:
- app/controllers/kkt_shoppe/product_categories_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/controllers/kkt_shoppe/product_categories_controller.rb', line 15 def create @product_category = KktShoppe::ProductCategory.new(safe_params) if @product_category.save redirect_to :product_categories, :flash => { :notice => t('kkt_shoppe.product_category.create_notice') } else render :action => "new" end end |
#destroy ⇒ Object
35 36 37 38 |
# File 'app/controllers/kkt_shoppe/product_categories_controller.rb', line 35 def destroy @product_category.destroy redirect_to :product_categories, :flash => { :notice => t('kkt_shoppe.product_category.destroy_notice') } end |
#edit ⇒ Object
24 25 |
# File 'app/controllers/kkt_shoppe/product_categories_controller.rb', line 24 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/kkt_shoppe/product_categories_controller.rb', line 7 def index @product_categories_without_parent = KktShoppe::ProductCategory.without_parent.ordered end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/kkt_shoppe/product_categories_controller.rb', line 11 def new @product_category = KktShoppe::ProductCategory.new end |
#update ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/kkt_shoppe/product_categories_controller.rb', line 27 def update if @product_category.update(safe_params) redirect_to [:edit, @product_category], :flash => { :notice => t('kkt_shoppe.product_category.update_notice') } else render :action => "edit" end end |