Saturday, December 19, 2009

Link_to + Style

Add the relevant code to :html as shown below
<%= link_to_remote 'click me',
:update => 'divid',
:url => {:controller => 'taxes', :action => 'show', :params => {:id => '2'}}, :html => {:style => 'text-decoration: none'} %>

You can also do :html => {:class => 'mycssclass'}

Note that this is different from link_to
<%= link_to 'click me', {:controller => 'taxes', :action => "show", :id => '2' }, :style => 'text-decoration: none' %>
which is annoying until you find out.