What is the equivelant of this in ruby on rails? I have installed bootstrap but my scss files are not reaching my html.erb files.
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
Thanks
What is the equivelant of this in ruby on rails? I have installed bootstrap but my scss files are not reaching my html.erb files.
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
Thanks
Just a shot in the dark, as we're not seeing how you have your stylesheets configured for your app, but I know there's some pretty specific (though somewhat awkward to locate) directions for establishing SCSS with Bootstrap within the GitHub documentation. Give this a shot (if you haven't already):
Import Bootstrap styles in app/assets/stylesheets/application.scss:
// Custom bootstrap variables must be set or import before bootstrap itself.
@import "bootstrap";
Make sure the file has .scss extension (or .sass for Sass syntax). If you have just generated a new Rails app, it may come with a .css file instead. If this file exists, it will be served instead of Sass, so rename it:
$ mv app/assets/stylesheets/application.css
app/assets/stylesheets/application.scss
Then, remove all the *= require and *= require_tree statements from the Sass file. Instead, use @import
to import Sass files.
Do not use *= require in Sass or your other stylesheets will not be able to access the Bootstrap mixins and variables.
This was all located here: https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails
I don't follow the instruction to remove all the *= require and *= require_tree statements... I just leave them, but when adding your @import
statements within your application.scss file (once it's renamed), be sure to have
@import "bootstrap-sprockets";
@import "bootstrap";
listed in that order with the file.