Rails: using link_to to make a link without href
ruby-on-rails
Solution
I use this approach:
= link_to('Click me', 'javascript:;', :id => :foo)
Its basically a Javascript `no-op`
Problem
How can I use the `link_to` helper to make a link without an `href` attribute? I want to make a link exclusively for a javascript action, I don't want it reloading the page or anything. When I omit the url parameter, clicking the link reloads the page. Ditto for providing `nil` in place of the url.