inshany-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-27 20:33 UTC
Need help with slide visual effect
Hi, I''m trying to accomplish the following: A) Show a list of items: (this works fine; the number are for reference only) 1. <ul> 2. <% for listing in @list_feeds -%> 3. <li> 4. <%= link_to_remote listing.feed.name, { :url => { :action => "show_delete_button" } }, :id => listing.id %> 5. <span id="feed-<%= listing.id %>" class="delete-button" style="display:none"> 6. <%= link_to_remote "Delete", :url => { :action => "remove_feed", :id => listing } %> 7. </span> 8. </li> 9. <% end -%> 10.</ul> Once this is rendered and click on the link (created by line#4) the "Delete" link (created by line#6) (initially hidden) will slide down into place. When the "Delete" link is clicked the item it appears next to is deleted. Now the problem I am having is that how do I display the proper "Delete" link? I have the following in the RJS file for "show_delete_button" action with the name of the element hard coded: page.visual_effect :toggle_slide, "feed-23" Somehow I need to send the listing.id to the RJS so that the proper "Delete" link slides into place. How do I do that? Is that even possible? Thanks in advance for the help. Farhan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---