I read many other related questions and just can't get this stone to work:
https://github.com/tsechingho/chosen-rails
as README says, I have
-included *= require chosen in my application.css
-included //= require chosen-jquery in my application.js
In addition, I tried to add the following element to the end of my file application.js:
jQuery(function($){
$('.chzn-select').chosen();
});
I also replaced .chzn-selectwith #user_education_idsand #user_school_idsbased on my model and view:
<% @schools = Education.all.map { |e| [ e.school, e.school ] } %>
<%= select_tag "school_ids", options_for_select((@schools), params[:education_id]), { :include_blank => true, :multiple => true } %>
I tried adding , :class=>'chzn-select'at the end :multiple => true, no luck
(The user has many educations, as well as many schools through education)
I donβt know why it causes me so much trouble, but it is. Help is much appreciated!
source
share