Hello,
after executing an action, I add an <li> element to an existing list
using a RJS template:
page.insert_html :bottom, :contributors, "<li
id=''contributor.#{@contributor.id}''>#{@contributor.user.name}</li>"
but I need to add an image with a link_to_remote as I have in a
partial page:
<li id="contributor.<%= contributor.id %>">
<%= link_to_remote image_tag(''delete.png'', :size
=>
''16x16'', :alt => ''Destroy''),
:url => {:action =>
"delete_contributor", :id => @project,
:contributor_id =>
contributor.id},
:method => :put %>
<%= contributor.user.name %>
</li>
How could I do this with RJS?, is it possible?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
As far as I know it can be done either way, but I second the partial idea. It''ll keep the rjs file a lot cleaner, and be much easier to maintain. -- Josh Christopher Kintner wrote:> On Thu, Jul 24, 2008 at 4:23 AM, Eduardo Y��ez Parareda > <eduardo.yanez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> partial page: >> </li> >> >> How could I do this with RJS?, is it possible? > > Try using a partial > > page.insert_html :bottom, :contributors, :partial => ''partial_name''-- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---