sortable_element... "No action responded to sort."
|
|
I believe I have copied the code correctly from the book on this one, but when I try to sort items by dragging and dropping, the server pipes up with an ActionController::UnknownAction, claiming that nothing would respond to sort. :( Is this caused by using Rails 2.3.2? in index.html.erb: <%= sortable_element ‘todo-list’, :url => { :action => “sort”, :id => @today }, :complete => visual_effect(:highlight, ‘todo-list’) %> in today_controller.rb:
|
|
|
It appears you may have a typo. I believe the line you have as todo.position = params['todo_list'.index(todo.id.to_s) + 1] should be like this (note where the closing right brace is): todo.position = params['todo_list'.index(todo.id.to_s)] + 1 Hope that helps. I’m just getting started on this whole Ruby/Rails thing so take any posts I enter with a grain of salt… |
|
|
Were you able to get this working? I’m not seeing the difference in the two lines of code that you posted. |
|
|
Sorry. It was a copy and paste typo in my response to the original post. I have since edited my post. |