Make a <tr>clickable

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

, 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? > content

Richard S. 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 , 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?

> content

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

see: http://api.rubyonrails.org/
see:
ActionController::Base

D.

I think you can make it done by jQuery or Prototype with CSS Selector:

content

On 4月1æ—¥, 下午12時39分, Richard S. <rails-mailing-l…@andreas-

Thanks, both work great! Though i guess neither would degrade well with
javascript turned off. Guess you cant have your clickable-rows and eat
them too :slight_smile: