OK, so I have a link_to_remote. I am too dumb to figure out where I can
set a css class or id attribute.
<%= link_to_remote(“X”, :url => { :action => :destroy, :id => message },
:confirm => “Delete '” + message.title + “’?”,
:complete => “item_removed('item_” + message.id.to_s + “’)”) %>
Can somebody help? It seems like it should be obvious, but the
documentation doesn’t show any examples that I could find.
Brian D. wrote:
OK, so I have a link_to_remote. I am too dumb to figure out where I can
set a css class or id attribute.
<%= link_to_remote(“X”, :url => { :action => :destroy, :id => message },
:confirm => “Delete '” + message.title + “’?”,
:complete => “item_removed('item_” + message.id.to_s + “’)”) %>
Can somebody help? It seems like it should be obvious, but the
documentation doesn’t show any examples that I could find.
Try this:
<%= link_to_remote(“X”, { :url => { :action => :destroy, :id => message
}, :confirm => “Delete '” + message.title + “’?”, :complete =>
“item_removed('item_” + message.id.to_s + “’)” }, { :style => “color:
red;” }) %>
Whew, that’s a doozy.
<%= link_to_remote(“X”, { :url => { :action => :destroy, :id => message
}, :confirm => “Delete '” + message.title + “’?”, :complete =>
“item_removed('item_” + message.id.to_s + “’)” }, { :style => “color:
red;” }) %>
That did it! Thanks. Now I get the whole
link_to_remote(name, options = {}, html_options = {})
syntax. Was struggling with that a bit.
If you are ever in doubt, try explicitly containing each options hash in
a {
}