Make a <tr>clickable


#1

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

#2

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:
http://api.rubyonrails.org/classes/ActionController/Base.html#M000624

D.


#3

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-


#4

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: