Rails bootstrap select2未正确加载

时间:2016-06-10 06:33:23

标签: ruby-on-rails twitter-bootstrap

git init

git add .

git commit -am "some comment"

git push heroku master

heroku open 

当输入下拉列表时,它会显示两个不同的框,其中一个显示下拉字段,另一个显示选择2个文本建议。我搜索了很多。但是可以

$(document).ready(function(){
  $( 'select' ).select2();
});

找不到确切的解决方案。

1 个答案:

答案 0 :(得分:1)

在application.js和application.css

中要求select2

*= require select2 (application.css)
//= require select2 (application.js)