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?
Try using a partial
page.insert_html :bottom, :contributors, :partial => 'partial_name'