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

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.
46debae767d963d4525269e094e6362f?d=identicon&s=25 sbellware (Guest)
on 2007-07-23 04:34
(Received via mailing list)
Folks,

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.

Thanks,
Scott
46debae767d963d4525269e094e6362f?d=identicon&s=25 sbellware (Guest)
on 2007-07-23 05: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.