I have a list of objects that are in a table. Each row of the table contains the elements of one object. The rows have dynamically generated id''s based on the object. I''ve created a destroy method for these objects, but I am not sure what to put in the rjs to remove the object from the list. -- 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 -~----------~----~----~----~------~----~------~--~---
Hi David, David Modernfossil wrote:> I have a list of objects that are in a table. Each row of the table > contains the elements of one object. The rows have dynamically > generated id''s based on the object. > > I''ve created a destroy method for these objects, but I am not sure what > to put in the rjs to remove the object from the list.If you''re using tables, as in <table>, you''ll be very limited to what you can do with Ajax. Best bet is to just re-render the table. hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jun 2, 6:49 pm, David Modernfossil <rails-mailing-l...@andreas- s.net> wrote:> I have a list of objects that are in a table. Each row of the table > contains the elements of one object. The rows have dynamically > generated id''s based on the object. > > I''ve created a destroy method for these objects, but I am not sure what > to put in the rjs to remove the object from the list.I''ve developed an app that can delete table rows with an Ajax call. I wrote a javascript delete function and call it from rjs. The script ultimately uses the built-in remove method: $(''my_row_id'').remove(); Since you''ve written your own method, have you tried simply: page[''my_row_''id].destroy in your rjs? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---