We write about Ruby on Rails, React.js, React Native, remote work, open source, engineering and design.
Rails has been dependent on jQuery
and the Ajax
Every Rails application before Rails 5.1
would have the
jquery-rails gem included by default.
jquery-rails gem contains the jquery-ujs
driver which provides all the nice unobtrusive features.
That's what has happened for the 5.1 release. The
as part of a GSoC project by Dangyui Liu.
approach would still be
available. It's just that it's not
part of the default stack.
You will need to manually add the
to newly created 5.1 application
and update the application.js to include the
It's worth noting that
rails-ujs only supports IE 11+.
Visit the Desktop Browser Support
section of Basecamp to see the full list of all the supported browsers.
We saw some discussion about which all browsers are supported without jQuery. We decided to test it ourselves on a plain vanilla CRUD Rails app. We tested "adding", "editing" and "deleting" of a resource.
We found that all three operations (adding, editing and deleting) to be working in following cases.
rails-ujs driver has changed the signature of the event handler functions
to just pass one
event object instead of
as in the case of
Check the documentation for the rails-ujs event handlers for more details.