New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foundation 5 topbar incompatible with Rails Turbolinks #3642
Comments
+1 this sucks. Specifically this won't work because you must include the foundation.js in the BODY tag. With turbolinks JS has to be included in HEAD, as the body gets wiped on each request — as noted in Issue #3643 |
There's a pretty simple fix: /pull/3668 You just need to (re)move FastClick or wrap Foundation in a closure and load when the DOM is ready. I've written a more detailed explanation in a comment of a related issue. |
What solved for me was to include "jquery.turbolinks" and bind the initialization to the jquery document ready |
I've built a simple Rails application that includes a Foundation 5 topbar. Here are the relevant files, in an implementation that works:
If I add Rails Turbolinks, the implementation fails.
Many Rails developers will attempt to use Turbolinks since Turbolinks is part of a standard Rails build. Turbolinks is part of a standard Rails build, with any new Rails application.
Here are the same files, with Turbolinks enabled:
The JavaScript console shows an error:
The text was updated successfully, but these errors were encountered: