I followed the example mentioned in
http://demo.script.aculo.us/ajax/sortable_elements
I am able to drag and drop Number1 to Number 6
But my problem is ....
Updated order always gives me the last number that is placed last in
the list.
That is if I replace Number6 with Number5,
it shows Updated Order:5
And also the params[:list] always give the last number in the list.
There is some prob that is hiddden. I tried all possibilities. But...
It never show me the entire array.
Please Help Plssss!
Rails version(V1.1.6)
Scriptaclous version(1.6.5)
in the demo it shows the entire array joined with ','
Updated Order : 2,1,3,4,5,6 ( if i move Number2 above Number1)
Source :
# view
<ul id="list">
<% 6.times do |i| -%>
<li id="item_<%= i+1 %>">I'm number <%= i+1 %></li>
<% end -%>
</ul>
<p id="list-info"></p>
<%= sortable_element 'list',
:update => 'list-info',
:complete => visual_effect(:highlight, 'list'),
:url => { :action => "order" } %>
# controller
def order
@order = params[:list]
render :partial => 'list'
end
# _list.rhtml partial
Updated order is: <%= @order.join(', ') %>.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---