$(document).on('turbolinks:load', function () {
  activateSanctuariesChosen();
});

function activateSanctuariesChosen() {
  var all_chosen_selects = $('.chosen-select');
  for (var i=0; i<all_chosen_selects.length;i++) {
    var chosen_select = all_chosen_selects[i];
    $(chosen_select).chosen({
      allow_single_deselect: true,
      no_results_text: 'No results matched',
      width: '100%'
    });
  }
}

@@ -122,171 +122,26 @@
 %7B%0A  
-var all_chosen_selects = $('.chosen-select');%0A  for (var i=0; i%3Call_chosen_selects.length;i++) %7B%0A    var chosen_select = all_chosen_selects%5Bi%5D;%0A    $(chosen_select
+$('.chosen-select'
 ).ch
@@ -147,18 +147,16 @@
 hosen(%7B%0A
-  
     allo
@@ -184,18 +184,16 @@
 ue,%0A    
- 
- 
 no_resul
@@ -227,18 +227,16 @@
 d',%0A    
-  
 width: '
@@ -245,18 +245,12 @@
 0%25'%0A
-  
   %7D);%0A
-  %7D%0A
 %7D%0A

use simpler code for chosen selects