Class: Pulitzer::ContentElementsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Pulitzer::ContentElementsController
- Defined in:
- app/controllers/pulitzer/content_elements_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
8 9 10 |
# File 'app/controllers/pulitzer/content_elements_controller.rb', line 8 def edit render partial: 'form', locals: { content_element: @content_element } end |
#show ⇒ Object
4 5 6 |
# File 'app/controllers/pulitzer/content_elements_controller.rb', line 4 def show render partial: 'show', locals: { content_element: @content_element } end |
#update ⇒ Object
12 13 14 15 |
# File 'app/controllers/pulitzer/content_elements_controller.rb', line 12 def update @content_element.update content_element_params render partial: 'show', locals: { content_element: @content_element } end |
#update_all ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/controllers/pulitzer/content_elements_controller.rb', line 17 def update_all content_elements = Pulitzer::ContentElement.find params[:content_element] content_elements.each do |ce| new_sort_order = params[:content_element].index(ce.id.to_s) ce.update_attribute(:sort_order, new_sort_order) end head :ok end |