Forum: Ruby on Rails sortable_element -- need a strategy

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
charlie caroff (Guest)
on 2007-06-22 02:36
(Received via mailing list)

I have listings that are numbered.  When I re-sort them, the first
page of results re-sorts fine in the database, but the second page is
ignored.  How do I renumber all listings?

Also, though the first page is re-sorted fine in the database,
listings numbers do not update on the page.  I'm inclined to have
an .rjs file that does a replace_html on all listings, but it would be
so much less data simply to have the listing numbers update.

Here is my code.  The :after part is not working.  redraw_listings is
an rjs that replaces all listings with the partial that creates them.

<%= sortable_element('listing', :tag => "div", :constraint =>
false, :scroll => :window,
:url => { :action => "sort_by_position" , :id => }, :containment => ['listing'], :after => { :action =>
'redraw_listings'} ) %>

Any hints?


This topic is locked and can not be replied to.