hey all,
I have a sortable list like that:
# view
<ul id="list">
<% 6.times do |i| -%>
<span class="item_position" id="item_position_<%= i+1
%>">
<%= i+1 %></span> <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
I would like to update the position number in the span item_position
as I drag and drop elements. As an exemple, if I drag element number 5
to the second position I would like to update its span to 2.
Any idea how to do that?
thanx in advance
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---