Class: Pulitzer::BackgroundStylesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Pulitzer::BackgroundStylesController
- Defined in:
- app/controllers/pulitzer/background_styles_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/pulitzer/background_styles_controller.rb', line 10 def create @background_style = Pulitzer::BackgroundStyle.create(background_style_params) if @background_style.errors.empty? render partial: 'show_wrapper', locals: {background_style: @background_style} else @post_type = @background_style.post_type render partial: 'new', locals: {background_style: @background_style} end end |
#destroy ⇒ Object
37 38 39 40 |
# File 'app/controllers/pulitzer/background_styles_controller.rb', line 37 def destroy @background_style.destroy head :ok end |
#edit ⇒ Object
24 25 26 |
# File 'app/controllers/pulitzer/background_styles_controller.rb', line 24 def edit render partial: 'form', locals: {background_style: @background_style} end |
#new ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/pulitzer/background_styles_controller.rb', line 4 def new @background_style = Pulitzer::BackgroundStyle.new(background_style_params) @post_type = @background_style.post_type render partial: 'new', locals: {background_style: @background_style} end |
#show ⇒ Object
20 21 22 |
# File 'app/controllers/pulitzer/background_styles_controller.rb', line 20 def show render partial: 'show', locals: {background_style: @background_style} end |
#update ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/controllers/pulitzer/background_styles_controller.rb', line 28 def update @background_style.update_attributes(background_style_params) if @background_style.errors.empty? render partial: 'show', locals: {background_style: @background_style} else render partial: 'form', locals: {background_style: @background_style}, status: 409 end end |