Class: Legacy::PostCategoriesController
- Inherits:
-
AdminController
- Object
- AdminController
- Legacy::PostCategoriesController
- Defined in:
- app/controllers/legacy/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.
-
#update ⇒ Object
patch /post_categories/:id.
Instance Method Details
#create ⇒ Object
post /post_categories
7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/legacy/post_categories_controller.rb', line 7 def create @entity = PostCategory.new creation_parameters if @entity.save cache_relatives redirect_to admin_post_category_path(id: @entity.id) else render :new, status: :bad_request end end |
#destroy ⇒ Object
delete /post_categories/:id
32 33 34 35 36 37 |
# File 'app/controllers/legacy/post_categories_controller.rb', line 32 def destroy if @entity.update deleted: true flash[:notice] = t('post_categories.destroy.success') end redirect_to admin_post_categories_path end |
#edit ⇒ Object
get /post_categories/:id/edit
18 19 |
# File 'app/controllers/legacy/post_categories_controller.rb', line 18 def edit end |
#update ⇒ Object
patch /post_categories/:id
22 23 24 25 26 27 28 29 |
# File 'app/controllers/legacy/post_categories_controller.rb', line 22 def update if @entity.update entity_parameters cache_relatives redirect_to admin_post_category_path(id: @entity.id), notice: t('post_categories.update.success') else render :edit, status: :bad_request end end |