Search code examples
ruby-on-railsrubyturbolinks

<select> design is not visible at first download


I use Rails 4 and bootstrap-select-rails gem. When I download page with my form, I got this

first download

When I refresh page, I got this

enter image description here

If I turn off turbolinks, design is ok, but site is very slow. How to display the correct design at first download without disabling turbolinks?

UPD: at application.js:

//= require bootstrap-select

at application.scss:

@import "bootstrap-select";

at view:

=select_tag "document_id",
  options_from_collection_for_select(@documents,'id', 'name'),
  class: "selectpicker", 
  "data-live-search".to_sym => "true"

Solution

  • I added data-no-turbolink attribute to link

    <a href="page_with_form" data-no-turbolink="true">New</a>