For my show action, I render show.js.erb. This happens when I click a link_to set up with a :remote => true
option. How can I set it up so this is triggered on hover?
Create a link with an attribute that won't trigger the Rails-UJS driver:
<%= link_to 'mouse over me!', '#', :'data-remote-on-hover' => true %>
and then wireup your own event:
$('a[data-remote-on-hover]').hover(function() {
// do something
})
HTML5 custom data attributes FTW!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.