######
require_tree .
を消していることが前提です.
application.css
には
ruby
1 * You're free to add application-wide styles to this file and they'll appear at the bottom of the 2 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 3 * files in this directory.
と書かれていますが,application.js
には
ruby
1// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 2// compiled file.
と書かれています.
試したこと
実際application.css
に共通のcssコードを書くと全体に適用されましたが,application.js
に共通のjsコードを書くと全体に適用されませんでした.
ということは,共通のjsコードはapplication.js
とは別の新しい.js.erb
ファイルに書き,それをapplication.html.erb
にjavascript_include_tag
を使って全体に適用するのが正しいのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/03/07 15:19