Ruby on Rails Configuration Rails General Configuration


Example

The following configuration options should be called on a Rails::Railtie object

  • config.after_initialize: Takes a block which will be run 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: This option accepts an array of paths where Rails autoloads constants. The default value is an empty array
  • config.autoload_paths: This accepts an array of paths where Rails autoloads constants. It defaults to all directories under app
  • config.cache_classes: Determines if classes and modules should be reloaded on each request. In development mode, this defaults to false and in the production and test modes it defaults to true
  • config.action_view.cache_template_loading: This determines if templates should be reloaded on each request. It defaults to the config.cache_classes setting
  • config.beginning_of_week: This sets the default beginning of week. It requires a valid week day symbol (:monday)
  • config.cache_store: Choose which cache store to use. Options include :file_store, :memory_store, mem_cache_store or null_store.
  • config.colorize_logging: This controls whether logging information is colorized
  • config.eager_load: Eager-loads all registered
  • 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 :debug in all environments.
  • config.middleware: Use this to configure the application's middleware
  • config.time_zone: This sets the application's default time zone.