2 ms·
After looking over the changelog and doing a little research: it seems like this Turbolinks thing is now default-on for Rails 4. This screws up the normal .rea
by angersock 13y ago
After looking over the changelog and doing a little research: it seems like this Turbolinks thing is now default-on for Rails 4.
This screws up the normal .ready() stuff, right? Has this bitten anyone yet?
- steveklabnik 13y agoYes, Turbolinks is included by default, but it's really easy to not use if you don't want to: http://blog.steveklabnik.com/posts/2013-06-25-removing-turbolinks-from-rails-4 http://blog.steveklabnik.com/posts/2013-06-25-removing-turbo...
- angersock 13y agoRight, this is good--but are fears of mysteriously-breaking javascript depending on the ready event unfounded?
- steveklabnik 13y agoBy 'the ready event' I'm assuming you mean the onload event. Those will break, you need to update them to listen to the 'page:ready' event instead. The Turbolinks README has everything you need to do to make your applications ready, if you choose to use it: https://github.com/rails/turbolinks#turbolinks https://github.com/rails/turbolinks#turbolinks
- breckenedge 13y agoIf you're using jquery, then there is already a gem for that: jquery-turbolinks (https://github.com/kossnocorp/jquery.turbolinks https://github.com/kossnocorp/jquery.turbolinks)
- mieko 13y agojquery-turbolinks as a drop-in fix worked great for my application. The only tweaks my own code required at that point were resources I assumed would die and be recreated on the next page load, like doubling up setInterval handles in domready.