Class: Pulitzer::CustomOptionListsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Pulitzer::CustomOptionListsController
- Defined in:
- app/controllers/pulitzer/custom_option_lists_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_option_lists_controller.rb', line 23 def create @custom_option_list = CustomOptionList.new(custom_option_list_params) if @custom_option_list.save render partial: 'show_wrapper', locals: { custom_option_list: @custom_option_list } else render partial: 'new', locals: { custom_option_list: @custom_option_list }, status: 409 end end |
#destroy ⇒ Object
40 41 42 43 |
# File 'app/controllers/pulitzer/custom_option_lists_controller.rb', line 40 def destroy @custom_option_list.destroy head :ok and return end |
#edit ⇒ Object
15 16 17 |
# File 'app/controllers/pulitzer/custom_option_lists_controller.rb', line 15 def edit render_ajax locals: { custom_option_list: @custom_option_list } end |
#index ⇒ Object
5 6 7 8 |
# File 'app/controllers/pulitzer/custom_option_lists_controller.rb', line 5 def index @custom_option_lists = CustomOptionList.all render_ajax end |
#new ⇒ Object
10 11 12 13 |
# File 'app/controllers/pulitzer/custom_option_lists_controller.rb', line 10 def new @custom_option_list = CustomOptionList.new(custom_option_list_params) render_ajax locals: { custom_option_list: @custom_option_list } end |
#show ⇒ Object
19 20 21 |
# File 'app/controllers/pulitzer/custom_option_lists_controller.rb', line 19 def show render_ajax locals: { custom_option_list: @custom_option_list } end |
#update ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/controllers/pulitzer/custom_option_lists_controller.rb', line 32 def update if @custom_option_list.update_attributes(custom_option_list_params) render partial: 'show', locals: { custom_option_list: @custom_option_list } else render partial: 'edit', locals: { custom_option_list: @custom_option_list }, status: 409 end end |