Looking for a way to achieve the same functionality as a link_to ... remote=> true
using JavaScript?
It may not even be necessary -
Imagine having a div containing the user's name and profile picture.
My goal is to have the entire div react to a click and navigate to a specific method (users#show
for instance) just like a link_to would do.
The issue with link_to is that it generates an a href
, making the text linkable and so on.
Unfortunately, I haven't been able to figure out how to make the entire div clickable, only the text itself.
To clarify further -
If link_to
corresponds to window.location
in JavaScript
Then what is the equivalent of link_to
with :remote=>true
in JavaScript?