Ask A Question

Notifications

You’re not receiving notifications from this thread.

Page enter with Turbolinks

Nelson Casanova asked in General

Good day,

I'm having an issue when entering a page and loading a resource. The resource is Selectize which otherwise working fine but when I enter the page with the functionality it will just not load selectize on the selected dropdown, instead, I need to fully refresh the page and it will work.

I tried adding data-turbolinks-action="replace" to the a tag linking to the page but that didnt work.

Also added:

document.addEventListener("turbolinks:load", function() {
$('#employer-list').selectize({
sortField: 'text'
});
});

to the bottom of the page but didn't work either... the only way of actually including Selectize functionality is by refreshing the page. (?) Is there a way of calling .selectize on page change or load?

Reply

Whoops! Got it. Navigate into the page with: <a href="/page" data-turbolinks="false"></a>

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,972+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.