Rails 3 doing <tr> onclick does the same ajax as: remote => true link

The title of the question says a lot about everything. Basically, I am trying to get every element of the tr table to perform the same onclick ajax behavior as: remote => true link. It seems that it would be easy, but I just can’t figure out which way it goes!

FYI, here is an example of a link that I would like to emulate inside tr:

link_to "link text here", stream_item, {:remote => true, "data-toggle" => "modal", 'data-target' => "#commentModal"} %>

I assume the approach is either to use jquery, or in the form:

<tr onclick="some stuff here">

Any pointers were massively evaluated.

Thank!

+3
source share
1 answer

, , . JS, .

  $('#myrow').click(function() {
      $('#mymodal).show();
  });

id:

<tr id="#myrow">Link Text</tr>
0

All Articles