Add CSS class to link_to tag
|
Just put controller related attributes between curly braces, the others will be rendered as html attributes. So, being the current controller "mycontroller", the following snippet: <%= link_to "MyLink", {:action => "list"}, :class => "my_css_class"%>
will be rendered as:
< a href="/mycontroller/list" class="my_css_class">MyLink</a>
|