Class: PostCategoriesController
- Inherits:
-
AdminController
- Object
- AdminController
- PostCategoriesController
- Defined in:
- app/controllers/post_categories_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
post /post_categories.
-
#destroy ⇒ Object
delete /post_categories/:id.
-
#edit ⇒ Object
get /post_categories/:id/edit.
-
#new ⇒ Object
get /post_categories/new.
-
#update ⇒ Object
patch /post_categories/:id.
Instance Method Details
#create ⇒ Object
post /post_categories
11 12 13 14 15 16 17 18 |
# File 'app/controllers/post_categories_controller.rb', line 11 def create @entity = PostCategory.new(creation_parameters) if @entity.save form_processed_ok(admin_post_category_path(id: @entity.id)) else form_processed_with_error(:new) end end |
#destroy ⇒ Object
delete /post_categories/:id
34 35 36 37 38 39 |
# File 'app/controllers/post_categories_controller.rb', line 34 def destroy if @entity.destroy flash[:notice] = t('post_categories.destroy.success') end redirect_to(post_categories_admin_post_type_path(id: @entity.post_type_id)) end |
#edit ⇒ Object
get /post_categories/:id/edit
21 22 |
# File 'app/controllers/post_categories_controller.rb', line 21 def edit end |
#new ⇒ Object
get /post_categories/new
6 7 8 |
# File 'app/controllers/post_categories_controller.rb', line 6 def new @entity = PostCategory.new end |
#update ⇒ Object
patch /post_categories/:id
25 26 27 28 29 30 31 |
# File 'app/controllers/post_categories_controller.rb', line 25 def update if @entity.update entity_parameters form_processed_ok(admin_post_category_path(id: @entity.id)) else form_processed_with_error(:edit) end end |