Renzo wrote:
> Hi, i'm having trouble implementing a sortable drag and drop list. in
> my controller i have the following code:
> def sort
> @test_case = TestCase.find(params[:id])
> @test_case.tasks.each do |task|
> task.position = params['task-list'].index(task.id.to_s) + 1
> task.save
> end
> render :layout => false
> end
>
> the drag and drop operations work but the database does not get
> updated. The list to be updated is in another controller though. I
> have tried several ways but still haven't got the DB to update. The
> code where i call the function:
>
> <%= sortable_element 'task_list', :url => { :action => "sort", :id =>
> test_case.id, :controller => 'test_case' },
> :complete => visual_effect(:highlight, 'task_list')%>
>
Have you tail'd your log files yet?
--
Robby Russell
http://www.robbyonrails.com # my blog
http://www.planetargon.com # my business
http://www.programmingrails.com # my book
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---