LoginSignup
1
0

More than 3 years have passed since last update.

【備忘録】rails g controller でcoffeeの代わりにjavascriptを生成する

Last updated at Posted at 2019-11-04

前置き

CoffeeScriptを使う予定がない。でもJavaScriptは使いたい。

rails g controller --no-assetsして、ファイルを手動で作成して...
やらなんやらするのが面倒な人向け。

環境

Rails 5.0.7.2
ruby 2.3.3

編集内容

以下ファイル内でApplication下に記述
javascript_engineで設定します。

config/application.rb
class Application < Rails::Application

  config.generators do |g|
    g.javascript_engine :js
  end

end

これで出来た!

参考にした資料(StackOverFlow)

1
0
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
1
0