ruby Rails应用程序配置生成器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby Rails应用程序配置生成器相关的知识,希望对你有一定的参考价值。

# frozen_string_literal: true

require File.expand_path('../boot', __FILE__)

# require 'rails'
# Pick the frameworks you want:
require 'active_model/railtie'
# require 'active_job/railtie'
# require 'active_record/railtie'
require 'action_controller/railtie'
require 'action_mailer/railtie'
# require 'action_view/railtie'
require 'sprockets/railtie'
# require 'rails/test_unit/railtie'
require 'i18n/backend/fallbacks'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module MyApp
  # Primary class to application
  class Application < Rails::Application
    # Configure generators
    config.generators do |generator|
      # Configure RSpec for test
      generator.test_framework :rspec
      generator.integration_tool :rspec

      # Application API
      # Disable views, helper and assets
      generator.view_specs false
      generator.helper_specs false
      generator.javascripts false
      generator.stylesheets false

      # Configure factory Girl
      # @see http://www.jetthoughts.com/blog/tech/2011/09/24/change-factory-girl-directory-path-for-rails-3-generator.html
      generator.fixture_replacement :factory_girl, dir: 'spec/factories'
    end
  end
end

以上是关于ruby Rails应用程序配置生成器的主要内容,如果未能解决你的问题,请参考以下文章

使用Ruby On Rails生成URL(url_for)

ruby Rails应用程序生成器调整了我的共同需求

ruby on rails 中使用pdfkit生成pdf

Ruby On Rails 3.1 中的尾随日志文件

Ruby/Rails:生成脚手架的代码在哪里

ruby Rails生成器