Class: Admin::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::CategoriesController
- Defined in:
- app/controllers/help_kit/admin/categories_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/controllers/help_kit/admin/categories_controller.rb', line 18 def create @category = Category.new(category_params) if @category.save redirect_to admin_categories_path else render 'new' end end |
#destroy ⇒ Object
37 38 39 40 |
# File 'app/controllers/help_kit/admin/categories_controller.rb', line 37 def destroy @category.destroy redirect_to admin_categories_path end |
#edit ⇒ Object
27 |
# File 'app/controllers/help_kit/admin/categories_controller.rb', line 27 def edit; end |
#index ⇒ Object
10 11 12 |
# File 'app/controllers/help_kit/admin/categories_controller.rb', line 10 def index @categories = Category.roots end |
#new ⇒ Object
14 15 16 |
# File 'app/controllers/help_kit/admin/categories_controller.rb', line 14 def new @category = Category.new end |
#update ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/controllers/help_kit/admin/categories_controller.rb', line 29 def update if @category.update(category_params) redirect_to admin_categories_path else render 'edit' end end |