{"action":"created","issue":{"url":"https://api.github.com/repos/rails/turbolinks/issues/566","labels_url":"https://api.github.com/repos/rails/turbolinks/issues/566/labels{/name}","comments_url":"https://api.github.com/repos/rails/turbolinks/issues/566/comments","events_url":"https://api.github.com/repos/rails/turbolinks/issues/566/events","html_url":"https://github.com/rails/turbolinks/issues/566","id":93331901,"number":566,"title":"Turbolinks 3 (and older) onclick on tr of a table can't trigger click if link isn't \"remote: true\"","user":{"login":"ginolon","id":7945858,"avatar_url":"https://avatars.githubusercontent.com/u/7945858?v=3","gravatar_id":"","url":"https://api.github.com/users/ginolon","html_url":"https://github.com/ginolon","followers_url":"https://api.github.com/users/ginolon/followers","following_url":"https://api.github.com/users/ginolon/following{/other_user}","gists_url":"https://api.github.com/users/ginolon/gists{/gist_id}","starred_url":"https://api.github.com/users/ginolon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ginolon/subscriptions","organizations_url":"https://api.github.com/users/ginolon/orgs","repos_url":"https://api.github.com/users/ginolon/repos","events_url":"https://api.github.com/users/ginolon/events{/privacy}","received_events_url":"https://api.github.com/users/ginolon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-06T17:27:07Z","updated_at":"2015-07-22T11:09:27Z","closed_at":"2015-07-20T13:38:44Z","body":"I have these code:\r\n\r\nIn **application.js**:\r\n\r\n```javascript\r\n    $(document).on('click', 'tr[data-link]', function(e) {\r\n    \tif($(e.target).closest('a').length) return;\r\n    \tvar puls = $('a#trClick', $(this).closest('tr').children('td'));\r\n        puls.trigger('click');\r\n    });\r\n```\r\n\r\nIn **my template.html.erb** I have:\r\n\r\n```ruby\r\n    <tr data-link=\"<%= element_path(element) %>\">\r\n      <td>\r\n        <%= link_to 'Wow', element, id: 'trClick', remote: true %>\r\n      </td>\r\n    </tr>\r\n```\r\n\r\nIf I remove from this `link_to` the `remote: true` tag, the click can't get triggered and the click on tr makes no effect. Why?\r\n\r\nSo I put this code in my **application.js** to make it works, but I think it is a mess:\r\n\r\n```javascript\r\n    $(document).on('click', 'tr[data-link]', function(e) {\r\n    \tif($(e.target).closest('a').length) return;\r\n    \tvar puls = $('a#trClick', $(this).closest('tr').children('td'))\r\n        \r\n        if(puls.data(\"remote\") == true) {\r\n          puls.trigger('click');\r\n        } else {\r\n          Turbolinks.visit(this.dataset.link);\r\n        }\r\n    });\r\n```\r\n\r\n**HOW TO FIX?**"},"comment":{"url":"https://api.github.com/repos/rails/turbolinks/issues/comments/123668748","html_url":"https://github.com/rails/turbolinks/issues/566#issuecomment-123668748","issue_url":"https://api.github.com/repos/rails/turbolinks/issues/566","id":123668748,"user":{"login":"ginolon","id":7945858,"avatar_url":"https://avatars.githubusercontent.com/u/7945858?v=3","gravatar_id":"","url":"https://api.github.com/users/ginolon","html_url":"https://github.com/ginolon","followers_url":"https://api.github.com/users/ginolon/followers","following_url":"https://api.github.com/users/ginolon/following{/other_user}","gists_url":"https://api.github.com/users/ginolon/gists{/gist_id}","starred_url":"https://api.github.com/users/ginolon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ginolon/subscriptions","organizations_url":"https://api.github.com/users/ginolon/orgs","repos_url":"https://api.github.com/users/ginolon/repos","events_url":"https://api.github.com/users/ginolon/events{/privacy}","received_events_url":"https://api.github.com/users/ginolon/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T11:09:27Z","updated_at":"2015-07-22T11:09:27Z","body":"I think is a problem with Turbolinks. Anyway, thanks. :dancers: "}}