Domanda

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.

È stato utile?

Soluzione

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

Altri suggerimenti

Try adding bootstrap.js to

app/assets/javascripts/bootstrap.js
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top