From a948beefee427876f9768b1d767a112ddac05254 Mon Sep 17 00:00:00 2001 From: bsag Date: Mon, 31 Oct 2005 07:52:07 +0000 Subject: [PATCH] Fixes #135 (projects page incorrectly referring to context page for Sortable drag and drop code, so changes to project sort order were not sticking after a refresh. Fixed #142 - the 500 error was being generated on dragging projects and contexts to reorder because the order method was looking for an order view and layout. I've added a :render => nothing statement to order now,and that seems to fix the error. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@158 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/controllers/context_controller.rb | 1 + tracks/app/controllers/project_controller.rb | 1 + tracks/app/views/project/list.rhtml | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tracks/app/controllers/context_controller.rb b/tracks/app/controllers/context_controller.rb index 9d85ce69..976be1bc 100644 --- a/tracks/app/controllers/context_controller.rb +++ b/tracks/app/controllers/context_controller.rb @@ -80,6 +80,7 @@ class ContextController < ApplicationController Context.update(id, :position => position + 1) end end + render :nothing => true end protected diff --git a/tracks/app/controllers/project_controller.rb b/tracks/app/controllers/project_controller.rb index 8294f193..d4375d0e 100644 --- a/tracks/app/controllers/project_controller.rb +++ b/tracks/app/controllers/project_controller.rb @@ -77,6 +77,7 @@ class ProjectController < ApplicationController Project.update(id, :position => position + 1) end end + render :nothing => true end protected diff --git a/tracks/app/views/project/list.rhtml b/tracks/app/views/project/list.rhtml index 70797f89..881bff4a 100644 --- a/tracks/app/views/project/list.rhtml +++ b/tracks/app/views/project/list.rhtml @@ -8,8 +8,8 @@ <% sortable_options = { :tag => 'div', :handle => 'handle', - :complete => visual_effect(:highlight, 'list-contexts'), - :url => {:controller => 'context', :action => 'order'} + :complete => visual_effect(:highlight, 'list-projects'), + :url => {:controller => 'project', :action => 'order'} }%> <%= sortable_element 'list-projects', sortable_options %>