Class: Pulitzer::PostTypesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Pulitzer::PostTypesController
- Defined in:
- app/controllers/pulitzer/post_types_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
13 14 15 16 17 |
# File 'app/controllers/pulitzer/post_types_controller.rb', line 13 def create @post_type = Pulitzer::PostType.create(post_type_params) Pulitzer::CreateSingletonPost.new(@post_type, post_params_name).call render partial: 'show_wrapper', locals: {post_type: @post_type} end |
#destroy ⇒ Object
33 34 35 36 |
# File 'app/controllers/pulitzer/post_types_controller.rb', line 33 def destroy @post_type.destroy render nothing: true end |
#edit ⇒ Object
23 24 25 |
# File 'app/controllers/pulitzer/post_types_controller.rb', line 23 def edit render partial: 'form', locals: {post_type: @post_type} end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/pulitzer/post_types_controller.rb', line 4 def index @post_types = Pulitzer::PostType.all end |
#new ⇒ Object
8 9 10 11 |
# File 'app/controllers/pulitzer/post_types_controller.rb', line 8 def new @post_type = Pulitzer::PostType.new render partial: 'new', locals: {post_type: @post_type} end |
#show ⇒ Object
19 20 21 |
# File 'app/controllers/pulitzer/post_types_controller.rb', line 19 def show render partial: 'show', locals: {post_type: @post_type} end |
#update ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/pulitzer/post_types_controller.rb', line 27 def update @post_type.update_attributes(post_type_params) Pulitzer::UpdateSingletonPost.new(@post_type, post_params_name).call render partial: 'show', locals: {post_type: @post_type} end |