Closed naaano closed 11 years ago
Thank you!!!!
Thank you !!
The problem with this approach is that if you arrive on the page via a turbolink page:change
event, the dropdown won't still work.
I was able to fix this issue by adding data-turbolinks-eval=false
to the to the application.js <script>
tag. By doing this, the application.js javascript isn't re-evaluated every time there is a page:change
event, so it doesn't break the dropdown js.
My application.html.slim
:
/ JS at the End
== javascript_include_tag 'application', 'data-turbolinks-eval': false
== javascript_include_tag params[:controller]
== yield(:page_javascript) if content_for?(:page_javascript)
Thanks to @reed on https://github.com/rails/turbolinks/issues/539
you have to add "data-no-turbolink" to the dropdowns to get them working.
This is not a turbolink nor bootstrap issue, but the mix of both. That's why i add this here. Just to help those pulling their hair off.