Hi, I am trying to get a sortable list working using the method oulined on this page: http://techsutra.blogspot.com/2006/09/actsaslist-in-ruby-on-rails.html I have the list displaying on my page but when I drag and drop and item nothing happens. When I look at the log no action has been taken at all. It seems as though when I drag and drop the item the update_positions code is not being run. Scott -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
development.log is your friend - it will tell you exactly where the site stops working. Things also need to show us: 1) the method 2) the view 3) relevant portion of development.log -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
***** The View *****
<div id="pages">
<ul id="sortable_list">
<% @pages.each do |list| %>
<li id="">"><%= page.name %></li>
<% end %>
</ul>
</div>
<%= sortable_element(''sortable_list'', :update =>
''pages'',
:complete =>
visual_effect(:highlight, ''sortable_list''),
:url => {:action =>
:update_positions}) %>
***** The Methods *****
def update_positions
params[:sortable_list].each_with_index do |id, position|
Page.update(id, :position => position+1)
end
@pages = Page.find(:all, :order => :position )
render :layout => false , :action => :reorder
end
def reorder
@pages = Page.find(:all, :order => :position )
end
***** development.log *****
When I drag and drop the list items nothing happens in this log file.
***** The Model *****
acts_as_list :order => :position
***** Notes *****
I have included all required javascript files and everything seems to be
set up properly just the update_positions method isn''t run when I move
an item
Scott
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---