Class: Admin::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::CategoriesController
- Defined in:
- app/controllers/my_forum/admin/categories_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 |
# File 'app/controllers/my_forum/admin/categories_controller.rb', line 14 def create @category = Category.new(category_params) @category.save ? redirect_to(admin_forums_path) : raise('category not created') end |
#edit ⇒ Object
19 20 21 22 |
# File 'app/controllers/my_forum/admin/categories_controller.rb', line 19 def edit @category = Category.find(params[:id]) @user_groups = UserGroup.all end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/my_forum/admin/categories_controller.rb', line 10 def new @category = Category.new end |
#update ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/my_forum/admin/categories_controller.rb', line 24 def update @category = Category.find(params[:id]) @category.update_attributes(category_params) redirect_to edit_admin_category_path(@category) end |