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

<tr class="clickable" rel="<%= my_route_path %>"><td>content</td></tr>

<script>
(function($){
$('tr.clickable').click(function(){ // You can use .live('click',
function(){}) if you use jQuery 1.3.1 or higher
  // Link to ...
});
})(jQuery);
</script>

On 4月1日, 下午12時39分, Richard Schneeman <rails-mailing-l...@andreas-
s.net> 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>
> --
> Posted viahttp://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