0
0

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 1 year has passed since last update.

ジェネレータの設定

Last updated at Posted at 2023-02-10

ジェネレータ設定について

ソースコードの雛形を生成するジェネレータという機能があります。

自動的にコントローラやビューファイルを生成してくれるのですが、自動的に生成しない様に設定を行います。

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

    config.load_defaults 6.0

    config.generators do |g|
      g.skip_routes true        #routes.rbの変更されず
      g.helper false            #ヘルパーファイルの生成せず
      g.assets false            #css,JavaScriptファイル生成せず
      g.test_framework :rspec   #testファイル生成せず
      g.controller_specs false  #specs_controller生成せず
      g.view_specs false        #specs_view生成せず
    end
  end
end
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?