Class: Pulitzer::CustomOptionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Pulitzer::CustomOptionsController
- Defined in:
- app/controllers/pulitzer/custom_options_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
23 24 25 26 27 28 29 30 |
# File 'app/controllers/pulitzer/custom_options_controller.rb', line 23 def create @custom_option = CustomOption.new(custom_option_params) if @custom_option.save render partial: 'show_wrapper', locals: { custom_option: @custom_option } else render partial: 'new', locals: { custom_option: @custom_option }, status: 409 end end |
#destroy ⇒ Object
40 41 42 43 |
# File 'app/controllers/pulitzer/custom_options_controller.rb', line 40 def destroy @custom_option.destroy head :ok and return end |
#edit ⇒ Object
15 16 17 |
# File 'app/controllers/pulitzer/custom_options_controller.rb', line 15 def edit render_ajax locals: { custom_option: @custom_option } end |
#index ⇒ Object
5 6 7 8 |
# File 'app/controllers/pulitzer/custom_options_controller.rb', line 5 def index @custom_options = CustomOption.all render_ajax end |
#new ⇒ Object
10 11 12 13 |
# File 'app/controllers/pulitzer/custom_options_controller.rb', line 10 def new @custom_option = CustomOption.new(custom_option_params) render_ajax locals: { custom_option: @custom_option } end |
#show ⇒ Object
19 20 21 |
# File 'app/controllers/pulitzer/custom_options_controller.rb', line 19 def show render_ajax locals: { custom_option: @custom_option } end |
#update ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/controllers/pulitzer/custom_options_controller.rb', line 32 def update if @custom_option.update_attributes(custom_option_params) render partial: 'show', locals: { custom_option: @custom_option } else render partial: 'edit', locals: { custom_option: @custom_option }, status: 409 end end |