質問

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