2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ruby on RailsのCSSの指定について

Last updated at Posted at 2013-12-24

railsでCSSがどこで指定されているかわからなかったので、メモ。

railsではCSSの指定はレイアウトファイルに以下のように記述されている。

<%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>

 
これでapp/assets/stylesheets/application.cssを読み込む。

次にapp/assets/stylesheets/application.cssを開くと、以下の行が記述されている。

 *= require_self
 *= require_tree .

require_tree .でapp/assets/stylesheets以下の全てのCSSが読み込まれるので、個々のCSSを指定しなくてもstylesheetsに置いておけば自動で読み込まれる。。
※読み込む順番は名前順。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?