Forum: Ruby on Rails How to add CSS tips to link_to_remote?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Charlie (Guest)
on 2006-04-04 12:51
The following code of tag clouds implementation:
  <%= link_to(h("<#{tag}>"), "tags/listmytag/#{tag}", { :style =>
"font-size: #{font_size}" } ) -%>

I want to change it to ajax style:
  <%= link_to_remote "<#{tag}>",
 { :url => { :controller => 'tags', :action => 'listmytag', :id =>
"#{tag}" },
           :update => "body"} %>
but I do not know how to add the "{ :style => "font-size: #{font_size}"
}" to link_to_remote to make the tags' different font size of the tag
cloud.

Thanks
Charlie
David T. (Guest)
on 2006-04-04 14:20
(Received via mailing list)
According to this:
http://api.rubyonrails.com/classes/ActionView/Help...

You can still pass in an HTML options hash, so you probably want:

 <%= link_to_remote "<#{tag}>",
 { :url => { :controller => 'tags', :action => 'listmytag', :id =>
"#{tag}" }, :update => "body"},
 { :style => "font-size: #{font_size}"}
 %>

HTH,
David
Charlie (Guest)
on 2006-04-04 15:23
David T. wrote:
> According to this:
> http://api.rubyonrails.com/classes/ActionView/Help...
>
> You can still pass in an HTML options hash, so you probably want:
>
>  <%= link_to_remote "<#{tag}>",
>  { :url => { :controller => 'tags', :action => 'listmytag', :id =>
> "#{tag}" }, :update => "body"},
>  { :style => "font-size: #{font_size}"}
>  %>
>
> HTH,
> David

Thanks,it get work!
This topic is locked and can not be replied to.