Class: DeedCategoriesController
- Inherits:
-
AdminController
- Object
- AdminController
- DeedCategoriesController
- Defined in:
- app/controllers/deed_categories_controller.rb
Overview
Managing deed categories
Instance Method Summary collapse
-
#check ⇒ Object
post /deed_categories/check.
-
#create ⇒ Object
post /deed_categories.
-
#destroy ⇒ Object
delete /deed_categories/:id.
-
#edit ⇒ Object
get /deed_categories/:id/edit.
-
#new ⇒ Object
get /deed_categories/new.
-
#update ⇒ Object
patch /deed_categories/:id.
Instance Method Details
#check ⇒ Object
post /deed_categories/check
8 9 10 11 12 |
# File 'app/controllers/deed_categories_controller.rb', line 8 def check @entity = DeedCategory.instance_for_check(params[:entity_id], entity_parameters) render 'shared/forms/check' end |
#create ⇒ Object
post /deed_categories
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/deed_categories_controller.rb', line 20 def create @entity = DeedCategory.new(creation_parameters) if @entity.save NetworkEntitySyncJob.perform_later(@entity.class.to_s, @entity.id) form_processed_ok(admin_deed_category_path(id: @entity.id)) else form_processed_with_error(:new) end end |
#destroy ⇒ Object
delete /deed_categories/:id
45 46 47 48 49 50 |
# File 'app/controllers/deed_categories_controller.rb', line 45 def destroy if @entity.destroy flash[:notice] = t('deed_categories.destroy.success') end redirect_to(admin_deed_categories_path) end |
#edit ⇒ Object
get /deed_categories/:id/edit
31 32 |
# File 'app/controllers/deed_categories_controller.rb', line 31 def edit end |
#new ⇒ Object
get /deed_categories/new
15 16 17 |
# File 'app/controllers/deed_categories_controller.rb', line 15 def new @entity = DeedCategory.new end |
#update ⇒ Object
patch /deed_categories/:id
35 36 37 38 39 40 41 42 |
# File 'app/controllers/deed_categories_controller.rb', line 35 def update if @entity.update(entity_parameters) NetworkEntitySyncJob.perform_later(@entity.class.to_s, @entity.id) form_processed_ok(admin_deed_category_path(id: @entity.id)) else form_processed_with_error(:edit) end end |