From f8f35f666613eff24d3988bda1a22cc40ef2ab30 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 12 Feb 2013 13:26:30 +0100 Subject: Make the call_elements table sortable by drag and drop. --- app/controllers/route_elements_controller.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app/controllers/route_elements_controller.rb') diff --git a/app/controllers/route_elements_controller.rb b/app/controllers/route_elements_controller.rb index 9c6f2b7..9c9033e 100644 --- a/app/controllers/route_elements_controller.rb +++ b/app/controllers/route_elements_controller.rb @@ -44,14 +44,14 @@ class RouteElementsController < ApplicationController redirect_to call_route_route_elements_path(@call_route), :notice => t('route_elements.controller.successfuly_destroyed') end - def move_higher - @route_element.move_higher - redirect_to :back - end + def sort + #call_route = RouteElement.find(params[:route_element].first).call_route + + params[:route_element].each do |route_element_id| + @call_route.route_elements.find(route_element_id).move_to_bottom + end - def move_lower - @route_element.move_lower - redirect_to :back + render nothing: true end private -- cgit v1.2.3