I have 3 pages home, sign in and sign up and there is a select/dropdown on sign up page so when I'm going from home page to sign in page then sign in page to sign up page, it gives an error $(...).formSelect is not a function
due to this dropdown not shown but when I refresh the same page it shows correctly
This is my code:-
$(document).on('turbolinks:load', function() {
$('select').formSelect();
M.updateTextFields();
});
I'm loading scripts in this manner in application.js
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require materialize
And using Turbolinks 5.2.0, Jquery v1.12 and Materialize v1.0.0 in ruby on rail
I got a solution, by adding data: { turbolinks: false }
in sign up anchor tag it will not happen. This is due to turbolinks so here I stopped the turbo link functionality.