Help us understand the problem. What is going on with this article?

Rails bootstrapの導入 sassのススメ

More than 3 years have passed since last update.

「rails bootstrap」とかでググるとbootstrapの導入をlessでやる記事ばかり出てきました。
lessが好きな方が多いか分からないですが、sassで導入したほうが楽なのでは?と思いました。
sassでstyle書くことが多いと思うので(←ただの主観)、わざわざlessを導入する必要はないと思うのです。

sassを使う僕としてはsassがいいです。
やり方、lessもsassも書いておきます。お好みのほうをお使い下さい。

less

Gemfile
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-rails'
$ budle install
$ rails g bootstrap:install

application.css と application.js に 自動的にbootstrapの記述が追加されています。
https://github.com/seyhunak/twitter-bootstrap-rails

sass

Gemfile
gem 'bootstrap-sass'
gem 'sass-rails'
$ bundle install

application.css -> application.scss

app/assets/stylesheets/application.scss
@import "bootstrap-sprockets";
@import "bootstrap";
app/assets/javascripts/application.js
//= require jquery
//= require bootstrap-sprockets

https://github.com/seyhunak/twitter-bootstrap-rails

以上で十分ですが、こちらのカスタマイズの記事も参考になると思います。
全部はいらないよね?bootstrap-sassをカスタマイズして使う方法

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした