Hi, I want to use rjs to make a sortable list. If I put this code in the index.html.erb view, it works: <%= sortable_element :people_list, :url => {:action => "sort" }, :tree => true %> I thought that I should be able to put this code into a file called index.js.rjs: page.sortable ''people_list'', :url => { :action => ''sort'' }, :tree => true This doesn''t work, however. Is there something else I need to do? Thanks, DAZ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Did you notice this warning from the Rails API: Important: For this to work, the sortable elements must have id attributes in the form "string_identifier". For example, "item_1". Only the identifier part of the id attribute will be serialized. If ''people_list'' is a <ul>, then each <li> should probably have an id like ''person_n''. Have you got that? On May 18, 11:46 am, DAZ <daz4...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I want to use rjs to make a sortable list. > > If I put this code in the index.html.erb view, it works: > <%= sortable_element :people_list, :url => {:action => "sort" }, :tree > => true %> > > I thought that I should be able to put this code into a file called > index.js.rjs: > page.sortable ''people_list'', :url => { :action => ''sort'' }, :tree => > true > > This doesn''t work, however. Is there something else I need to do? > > Thanks, > > DAZ--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yes, that bit is fine because the list works fine if the helper is in erb page. The problem seems to be trying to get the rjs page to work. thanks for the suggestion, DAZ On May 19, 4:39 pm, AndyV <AndyVana...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Did you notice this warning from the Rails API: > Important: For this to work, the sortable elements must have id > attributes in the form "string_identifier". For example, "item_1". > Only the identifier part of the id attribute will be serialized. > > If ''people_list'' is a <ul>, then each <li> should probably have an id > like ''person_n''. Have you got that? > > On May 18, 11:46 am, DAZ <daz4...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > I want to use rjs to make a sortable list. > > > If I put this code in the index.html.erb view, it works: > > <%= sortable_element :people_list, :url => {:action => "sort" }, :tree > > => true %> > > > I thought that I should be able to put this code into a file called > > index.js.rjs: > > page.sortable ''people_list'', :url => { :action => ''sort'' }, :tree => > > true > > > This doesn''t work, however. Is there something else I need to do? > > > Thanks, > > > DAZ--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---