Forum: Ruby on Rails css classes

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.
A71bcb92b36f48a83f06f9f0b1273990?d=identicon&s=25 Greg (Guest)
on 2006-03-03 19: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" %>
A2c85dc5ee81b12e3cc0a6522e8d079d?d=identicon&s=25 Chris Hall (Guest)
on 2006-03-03 20:02
(Received via mailing list)
<%= link_to "Pages", { :controller => 'page', :action => 'list' },
:class =>
'someclass' -%>
A71bcb92b36f48a83f06f9f0b1273990?d=identicon&s=25 Greg (Guest)
on 2006-03-03 20: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.