Forum: Ruby on Rails How to do link_to with query parameter AND css class

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.
sbellware (Guest)
on 2007-07-23 06:34
(Received via mailing list)

I've been trying to get a number of variations of the following line
of template code to work:
<%= link_to 'Show contact details', :controller => 'people', :action
=> 'show', :class => 'actionLink', :id => person %>

I've tied putting curlies around the controller and action as well as
the class, but I haven't got it to work.  I've found some variations
that will render the css class, but not the query parameter.

sbellware (Guest)
on 2007-07-23 07:07
(Received via mailing list)
Doh!  Figured it out:

<%= link_to 'Show contact details', {:controller => 'people', :action
=> 'show', :id => person}, {:class => 'actionLink'} %>
This topic is locked and can not be replied to.