I have a Rails application that I recently upgraded to 5.0.0.RC1 . Most of the transition went smoothly, but I have problems with the new Turbolinks. In my application, for example, I use this stone:
gem 'chosen-rails'
My application.js file is as follows:
//= require jquery //= require jquery.turbolinks //= require jquery_ujs //= require best_in_place //= require tether //= require bootstrap //= require chosen-jquery //= require_tree . //= require turbo links
When I click on the link and visualize the view, my chosen-query ( best_in_place doesn’t work either) doesn’t work at initial load, but if I do a hard refresh of the page, it works. Below is the image of the result that I get:

And here is the image of how I want it to look:

And again, the expected result of the work, if I do a hard page refresh, but not after the usual redirect_to ...
The code for my dropdown is as follows:
= select_tag :screen, options_from_collection_for_select(@screens, "id", "name"), id: "screen-selection", prompt: "Jump to screen", class: 'form-control chosen-select', style: "max-width: 250px !important"
After redirect_to it outputs the following HTML:
<select name="screen" id="screen-selection" class="form-control chosen-select" style="max-width: 250px !important">[...]</select>
... and after hard reloading the page, I get the following:
<select name="screen" id="screen-selection" class="form-control chosen-select" style="max-width: 250px !important; display: none;">[...]</select> <div class="chosen-container chosen-container-single" style="width: 190px;" title="" id="screen_selection_chosen"><a class="chosen-single"><span>Jump to screen</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off"></div><ul class="chosen-results"><li class="active-result result-selected" data-option-array-index="0" style="">Jump to screen</li><li class="active-result" data-option-array-index="1" style="">tests</li></ul></div></div>
In the .coffee file .coffee I try to initialize the chosen as follows:
# enable chosen js $('#screen-selection').chosen({ width: '190px' })
Any ideas on what I'm doing wrong?