Richard Schneeman wrote:
> I would like to make an entire table row clickable so the user will be
> directed to another url. If i was using hand written javascript i would
> just add an onclick to the <tr>, but i want to use rails routes and to
> be able to pass in parameters from ruby. What is the best way to
> accomplish this?
> 
> <tr onclick = <%= link_to my_route_path %> > <td>content</td></tr>

onclick="window.location.href = '<%= url_for :controller => ':foo' 
:action => 'bar' %>'

see: http://api.rubyonrails.org/
see: 
http://api.rubyonrails.org/classes/ActionController/Base.html#M000624

D.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to