Hey all,
I have a sortable element list that looks like this:
<ul id="yourranking" style=" list-style-type:none;
margin:0;
padding:0;">
<% @uranks.each do |u| %>
<li id="item_<%= u.id %>"> <%= u.rank %> <%=
u.item.title %> </li>
<% end %>
</ul>
<p id="list-info"></p>
<%= sortable_element ''yourranking'',
:update => ''list-info'',
:complete => visual_effect(:highlight,
''yourranking''),
:url => { :controller=>"lists",:action =>
"order", :listid=>
''yourranking''} %>
</fieldset>
this is the controller code:
def order
params[params[:listid]].each_with_index { |id,idx| Urank.update(id,
:rank => idx) }
end
I would like to keep track of the old ranking before the latest update like:
Urank.update(id,:rank=>idx,:oldrank=><old rank before update>)
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
-~----------~----~----~----~------~----~------~--~---