Forum: Ruby on Rails css classes

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Greg (Guest)
on 2006-03-03 20:51
Can't find any documentation about this so...
Is there a way to assign a class within a link_to method and if so how?

For example, I need the following to format <a href="link"
class="class">link</a> from <%= link_to "Pages", :controller => 'page',
:action => "list" %>
Chris H. (Guest)
on 2006-03-03 21:02
(Received via mailing list)
<%= link_to "Pages", { :controller => 'page', :action => 'list' },
:class =>
'someclass' -%>
Greg (Guest)
on 2006-03-03 21:21
I had tried that but without putting the controller and action in
brackets.  That works great!  Thanks!
This topic is locked and can not be replied to.