eyp
1
Hello,
after executing an action, I add an
element to an existing list
using a RJS template:
page.insert_html :bottom, :contributors, “#{@contributor.user.name}
”
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 %>
How could I do this with RJS?, is it possible?
eyp
2
On Thu, Jul 24, 2008 at 4:23 AM, Eduardo Yáñez Parareda
[email protected] wrote:
partial page:
How could I do this with RJS?, is it possible?
Try using a partial
page.insert_html :bottom, :contributors, :partial => ‘partial_name’
eyp
3
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
[email protected] wrote:
partial page:
How could I do this with RJS?, is it possible?
Try using a partial
page.insert_html :bottom, :contributors, :partial => ‘partial_name’