Class: Storytime::Dashboard::LinksController
- Inherits:
-
Storytime::DashboardController
- Object
- ApplicationController
- Storytime::DashboardController
- Storytime::Dashboard::LinksController
- Defined in:
- app/controllers/storytime/dashboard/links_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#authenticate_user!, #current_user, #setup, #user_signed_in?
Methods included from Concerns::CurrentSite
Methods included from Concerns::ControllerContentFor
#content_for, #content_for?, #view_context
Instance Method Details
#sort ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'app/controllers/storytime/dashboard/links_controller.rb', line 6 def sort current_storytime_site, :manage? @navigation = Navigation.find(params[:navigation_id]) params[:link].each_with_index do |id, index| @navigation.links.where(id: id).update_all({position: index+1}) end render nothing: true end |