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.
--
Posted via http://www.ruby-forum.com/.
Brian Donahue 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. -- Posted via http://www.ruby-forum.com/.
> <%= 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. -- Posted via http://www.ruby-forum.com/.
If you are ever in doubt, try explicitly containing each options hash in a {
}
On 2/18/06, Brian Donahue <stuff@pigeonmoon.com>
wrote:>
>
> > <%= 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.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Cheers,
Luke Redpath
www.lukreedpath.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060219/920c8eaf/attachment.html