I was looking for a way to make table row clickable.
I found answer here, but it has one quite bad bug. It only lets you open link once. Even if you're redirected, and then you press "back" button, you can't click again.
I personally would put an
onclickevent on thetrusing jQuery. Thetrelement would look like this:<tr data-link="<%= edit_scout_path(scout) %>"> ... </tr>And then the associated JavaScript (placed in a file such as
app/assets/javascripts/scouts.js) would be something like this:$("tr[data-link]").click(function() { window.location = this.data("link") })This would make all
trelements that have adata-linkattribute act as if they were URLs in the most unobtrusive way I can think possible.
Only thing that makes it work again is refreshing site, which is really frustrating.
Do you know how may I fix this issue?