Class: Pulitzer::PostTypeContentElementTypesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Pulitzer::PostTypeContentElementTypesController
- Defined in:
- app/controllers/pulitzer/post_type_content_element_types_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/pulitzer/post_type_content_element_types_controller.rb', line 10 def create @post_type = Pulitzer::PostType.find(ptcet_params[:post_type_id]) @ptcet = @post_type.post_type_content_element_types.create(ptcet_params) Pulitzer::CreatePostTypeContentElements.new(@ptcet).call render partial: 'show_wrapper', locals: {ptcet: @ptcet} end |
#destroy ⇒ Object
32 33 34 35 36 |
# File 'app/controllers/pulitzer/post_type_content_element_types_controller.rb', line 32 def destroy @ptcet.destroy Pulitzer::DestroyPostTypeContentElements.new(@ptcet).call head :ok end |
#edit ⇒ Object
21 22 23 |
# File 'app/controllers/pulitzer/post_type_content_element_types_controller.rb', line 21 def edit render partial: 'form', locals: {ptcet: @ptcet} end |
#new ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/pulitzer/post_type_content_element_types_controller.rb', line 4 def new @post_type = Pulitzer::PostType.find(params[:post_type_id]) @ptcet = @post_type.post_type_content_element_types.build render partial: 'new', locals: {ptcet: @ptcet} end |
#show ⇒ Object
17 18 19 |
# File 'app/controllers/pulitzer/post_type_content_element_types_controller.rb', line 17 def show render partial: 'show', locals: {ptcet: @ptcet} end |
#update ⇒ Object
25 26 27 28 29 30 |
# File 'app/controllers/pulitzer/post_type_content_element_types_controller.rb', line 25 def update old_label = @ptcet.label @ptcet.update_attributes(ptcet_params) Pulitzer::UpdatePostTypeContentElements.new(@ptcet, old_label).call render partial: 'show', locals: {ptcet: @ptcet} end |