Rails General Configuration
suggest changeSet these on Rails.application.config, in config/application.rb or an environment file. They are application settings, not methods you call on a Rails::Railtie.
- config.after_initialize: Takes a block which runs after Rails has initialized the application.
- config.asset_host: This sets the host for the assets. This is useful when using a Content Delivery Network. This is shorthand for
config.action_controller.asset_host - config.autoload_once_paths: Paths autoloaded once and not reloaded. The default is an empty array. Entries must also be on the autoload path.
- config.autoload_paths: Extra directories for the classic autoloader. It already includes the existing directories under
app. Rails 6 Zeitwerk does not treat this as a list of roots to autoload wholesale. - config.cache_classes: Determines if classes and modules should be reloaded on each request. In development mode, this defaults to
falseand in the production and test modes it defaults totrue - config.action_view.cache_template_loading: This determines if templates should be reloaded on each request. It defaults to the
config.cache_classessetting - config.beginning_of_week: This sets the default beginning of week. It requires a valid week day symbol (
:monday) - config.cache_store: Which cache store to use. Options include
:file_store,:memory_store,:mem_cache_store, and:null_store. - config.colorize_logging: This controls whether logging information is colorized
- config.eager_load: When true, eager-loads registered namespaces at boot. Defaults to true in production and false in development and test.
- config.encoding: Specifies the application encoding. The default value is
UTF-8 - config.log_level: Sets the verbosity of the Rails Logger. It defaults to
:debugin all environments. - config.middleware: Use this to configure the application’s middleware
- config.time_zone: This sets the application’s default time zone.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents