CSSファイルの読み込み
rails newによってアプリケーションを作成した際にはapplication.cssに
*= require_tree .
の記述がある。この記述によって同じディレクトリにあるcssファイルは読み込まれる。
またこのrequireはアセットパイプラインの仕組みによってファイルを読み込む。
アセットパイプラインはcssファイルやjavascriptファイルを一つにまとめて圧縮し処理速度をあげる仕組み。
アセットパイプラインはsprocketsと言うgemによって実装されている。
SCSSファイルの読み込み
scssファイルはapplication.scssに@importを記述することでscssファイルをインポートする。
この@importはscssのメソッドであり拡張子をscss(application.scss)にしないと使えない。
application.scssからscssファイルをインポートするために使用するメソッドである。