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

Rails4.2.0 Bootstrapを導入

More than 5 years have passed since last update.

以下のURLからBootstrapをダウンロードする。
http://getbootstrap.com/getting-started/#download

ダウンロードしたファイルを解凍し、以下の作業を行う。

bootstrapのcssとjsを配置

「vendor/assets/stylesheets/」に「bootstrap.min.css」を配置
「vendor/assets/javascripts/」に「bootstrap.min.js」を配置

配置したファイルをAsset Pipelineのリストに含める

「app/assets/javascripts/application.js」に「//= require bootstrap.min」を追記する。
以下のような記述となる。

app/assets/javascripts/application.js
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap.min
//= require_tree .

「app/assets/stylesheets/application.css」に「 *= require bootstrap.min」を追記する。
以下のような記述となる。

app/assets/stylesheets/application.css
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
 * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *
 *= require_tree .
 *= require_self
 *= require bootstrap.min
 */

これまでの作業を行うことで、Bootstrapが適用される。

MasahideTakamura
業務が多忙の為、なかなかアウトプットできませんが、コツコツ記述していきます。
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
ユーザーは見つかりませんでした