Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2014-08-04 10:19:14 +0400
committerGleb Mazovetskiy <glex.spb@gmail.com>2014-08-04 10:19:14 +0400
commit8f8cf6b27232662df5b1e9f4788b89b6824dc2f4 (patch)
treeef3cf33022703576a48219f9ffd243c625c55750 /README.md
parent4730db67a8136b87a55180a467dcbaefc73c3026 (diff)
Update Rails guide [ci skip]
* Emphasize application.css.*scss* extension, because Rails 4.1 generates application.*css* by default * Add Bower with Rails section
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 22 insertions, 2 deletions
diff --git a/README.md b/README.md
index 18b028d..26ac7f3 100644
--- a/README.md
+++ b/README.md
@@ -26,22 +26,42 @@ gem 'autoprefixer-rails'
`bundle install` and restart your server to make the files available through the pipeline.
-In `app/assets/stylesheets/application.css.scss`:
+Import Bootstrap styles in `app/assets/stylesheets/application.css.scss`:
```scss
@import "bootstrap-sprockets";
@import "bootstrap";
```
+Make sure the file has `.css.scss` extension (or `.css.sass` for Sass syntax).
+
+If you have just generated a new Rails app, it may have an `application.css` file instead.
+If this file exists, it will be served instead of Sass, so remove it:
+
+```console
+$ rm app/assets/stylesheets/application.css
+```
+
Do not use `//= require` in Sass or your other stylesheets will not be [able to access][antirequire] the Bootstrap mixins or variables.
-In `app/assets/javascripts/application.js`:
+Require Bootstrap Javascripts in `app/assets/javascripts/application.js`:
```js
//= require jquery
//= require bootstrap-sprockets
```
+#### Bower with Rails
+
+When using bootstrap-sass Bower package in Rails, ensure [minimum number precision](#sass-number-precision):
+
+```ruby
+# e.g. config/initializers/sass.rb
+::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
+```
+
+`bootstrap-sprockets` must be imported before `bootstrap` for the icon fonts to work.
+
#### Rails 3.2.x
Rails 3.2 is [no longer maintained for bugfixes](http://guides.rubyonrails.org/maintenance_policy.html), and you should upgrade as soon as possible.