Reputation: 7683
I've tried to integrate bootstrap following this procedure found on stackoverflow (my rails version is the 3.2.17, this is a difference), so without a gem but just including the bootstrap files in the relevant project directories.
Then i've created an HTML page and i put it in the project public directory.
This is the code:
<!DOCTYPE html> <html> <head> <title>Bootsrap Test 01</title> <link rel="stylesheet" href="css/bootstrap.css"> <script src="js/bootstrap.min.js" type="text/javascript"></script> </head> ...
But when i load the page and inspect it (it loads) i can see that the GETs produces the errors below:
GET http://localhost:3000/css/bootstrap.css 404 (Not Found)
GET http://localhost:3000/js/bootstrap.min.js 404 (Not Found)
Upvotes: 1
Views: 3649
Reputation: 8392
From the error i think your app try to find bootstrap.css in a folder called css inside your public directory and another file called bootstrap.min.js in a folder called js inside the public directory too, so verify if this is what you are doing :)
this is my preferred way for adding bootstrap to Rails app :
then add this line : *= require bootstrap.min
to app/assets/stylesheets/application.css file like this :
*= require bootstrap.min
*= require_self
*= require_tree .
and also add //= require bootstrap.min
to app/assets/javascripts/application.js file like this :
//= require jquery
//= require jquery_ujs
//= require bootstrap.min
//= require_tree .
Restart your server and that's it.
Hope this help
Upvotes: 2