문제

I download bootstrap and put bootstrap.css and bootstrap.js into my_app/vendor/assets/stylesheets and my_app/vendor/assets/javascripts respectively and also edit these files as follow:

app/assets/javascripts/application.js

//= require bootstrap

app/assets/stylesheets/application.css

 *= require bootstrap

bootstrap.css is loaded properly but having problem to load bootstrap.js.

도움이 되었습니까?

해결책

And now you have a problem with loading the icons. I prefer to use the bootstrap-sass gem, where bootstrap is completely prepared for the asset pipeline, and sass, so I can even extend my own sass files with it. That way also the glyphs are loaded correctly. But I prefer font-awesome for my glyphs, instead.

So in my Gemfile I write:

group :assets do
  gem 'bootstrap-sass'
  gem 'font-awesome-rails'
end

다른 팁

Try adding bootstrap.js to

app/assets/javascripts/bootstrap.js
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top