开发者

Chosen Plug-in still not working

I'm trying to use the Chosen jquery plugin, i have all the right files but i can't call the function correctly. I took a look at the java error console, it loads but i get the error:

Error: $(".c开发者_Python百科hzn-select").chosen is not a function
Source File: http://localhost:3000/javascripts/application.js?1312657233

This is my application.js( the only thing inside of it):

jQuery(function($){
    $('.chzn-select').chosen();
});

This the form code i am using:

<%= select("user_product", "product_id", Product.all.collect {|p| [ p.name, p.id ] }, {},{:class=>'chzn-select'}) %>

javascript folder:

application.js
chosen.jquery.js
jquery_ujs.js
jquery.js
jquery.min.js
jquery.tokeninput.js

How do i call this correctly so i can get this working or maybe a change in my form?


Check your app/view/layout/application.html.erb view and add <%= javascript_include_tag "chosen.jquery" %> and <%= javascript_include_tag "jquery.min" %>. It should include what's missing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜