Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Your Rails Config

config.i18n.railties_load_path

no docs for i18n.railties_load_path found in rails guides

["/Users/schneems/.gem/ruby/2.1.2/gems/will_paginate-3.0.4/lib/will_paginate/locale/en.yml", "/Users/schneems/.gem/ruby/2.1.2/gems/devise-3.2.4/config/locales/en.yml", "/Users/schneems/Documents/projects/codetriage/config/locales/devise.en.yml", "/Users/schneems/Documents/projects/codetriage/config/locales/en.yml"]

config.i18n.load_path

  • config.i18n.load_path sets the path Rails uses to look for locale files. Defaults to config/locales/*.{yml,rb}.

Configuring Active Record

config.active_record includes a variety of configuration options:

["/Users/schneems/.gem/ruby/2.1.2/gems/will_paginate-3.0.4/lib/will_paginate/locale/en.yml", "/Users/schneems/.gem/ruby/2.1.2/gems/devise-3.2.4/config/locales/en.yml", "/Users/schneems/Documents/projects/codetriage/config/locales/devise.en.yml", "/Users/schneems/Documents/projects/codetriage/config/locales/en.yml"]

config.active_support.deprecation

  • ActiveSupport::Deprecation.behavior alternative setter to config.active_support.deprecation which configures the behavior of deprecation warnings for Rails.
:log

config.action_dispatch.x_sendfile_header

  • Rack::Sendfile intercepts responses whose body is being served from a file and replaces it with a server specific X-Sendfile header. Configurable with config.action_dispatch.x_sendfile_header.
nil

config.action_dispatch.ip_spoofing_check

  • ActionDispatch::RemoteIp checks for IP spoofing attacks and gets valid client_ip from request headers. Configurable with the config.action_dispatch.ip_spoofing_check, and config.action_dispatch.trusted_proxies options.
true

config.action_dispatch.show_exceptions

  • ActionDispatch::ShowExceptions rescues any exception returned by the application and renders nice exception pages if the request is local or if config.consider_all_requests_local is set to true. If config.action_dispatch.show_exceptions is set to false, exceptions will be raised regardless.
true

config.action_dispatch.tld_length

  • config.action_dispatch.tld_length sets the TLD (top-level domain) length for the application. Defaults to 1.
1

config.action_dispatch.ignore_accept_header

no docs for action_dispatch.ignore_accept_header found in rails guides

false

config.action_dispatch.rescue_responses.ActiveRecord::RecordNotFound

no docs for action_dispatch.rescue_responses.ActiveRecord::RecordNotFound found in rails guides

:not_found

config.action_dispatch.rescue_responses.ActiveRecord::StaleObjectError

no docs for action_dispatch.rescue_responses.ActiveRecord::StaleObjectError found in rails guides

:conflict

config.action_dispatch.rescue_responses.ActiveRecord::RecordInvalid

no docs for action_dispatch.rescue_responses.ActiveRecord::RecordInvalid found in rails guides

:unprocessable_entity

config.action_dispatch.rescue_responses.ActiveRecord::RecordNotSaved

no docs for action_dispatch.rescue_responses.ActiveRecord::RecordNotSaved found in rails guides

:unprocessable_entity

config.action_dispatch.default_charset

no docs for action_dispatch.default_charset found in rails guides

nil

config.action_dispatch.rack_cache

no docs for action_dispatch.rack_cache found in rails guides

false

config.action_dispatch.http_auth_salt

  • config.action_dispatch.http_auth_salt sets the HTTP Auth salt value. Defaults to 'http authentication'.
"http authentication"

config.action_dispatch.signed_cookie_salt

  • config.action_dispatch.signed_cookie_salt sets the signed cookies salt value. Defaults to 'signed cookie'.
"signed cookie"

config.action_dispatch.encrypted_cookie_salt

  • config.action_dispatch.encrypted_cookie_salt sets the encrypted cookies salt value. Defaults to 'encrypted cookie'.
"encrypted cookie"

config.action_dispatch.encrypted_signed_cookie_salt

  • config.action_dispatch.encrypted_signed_cookie_salt sets the signed encrypted cookies salt value. Defaults to 'signed encrypted cookie'.
"signed encrypted cookie"

config.action_dispatch.perform_deep_munge

  • config.action_dispatch.perform_deep_munge configures whether deep_munge method should be performed on the parameters. See Security Guide for more information. It defaults to true.
true

config.action_dispatch.default_headers.X-Frame-Options

no docs for action_dispatch.default_headers.X-Frame-Options found in rails guides

"SAMEORIGIN"

config.action_dispatch.default_headers.X-XSS-Protection

no docs for action_dispatch.default_headers.X-XSS-Protection found in rails guides

"1; mode=block"

config.action_dispatch.default_headers.X-Content-Type-Options

no docs for action_dispatch.default_headers.X-Content-Type-Options found in rails guides

"nosniff"

config.action_dispatch.best_standards_support

no docs for action_dispatch.best_standards_support found in rails guides

:builtin

config.action_dispatch.always_write_cookie

no docs for action_dispatch.always_write_cookie found in rails guides

true

config.action_controller.perform_caching

  • config.action_controller.perform_caching configures whether the application should perform caching or not. Set to false in development mode, true in production.
false

config.action_controller.assets_dir

no docs for action_controller.assets_dir found in rails guides

"/Users/schneems/Documents/projects/codetriage/public"

config.action_controller.logger

  • config.action_controller.logger accepts a logger conforming to the interface of Log4r or the default Ruby Logger class, which is then used to log information from Action Controller. Set to nil to disable logging.
#<ActiveSupport::Logger:0x007f8db52d4f70 @progname=nil, @level=0, @default_formatter=#<Logger::Formatter:0x007f8db52d4f20 @datetime_format=nil>, @formatter=#<ActiveSupport::Logger::SimpleFormatter:0x007f8db1bbd6e0 @datetime_format=nil>, @logdev=#<Logger::LogDevice:0x007f8db52d4ed0 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<File:/Users/schneems/Documents/projects/codetriage/log/development.log>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x007f8db52d4ea8 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x007f8db52d4e58>>>>

config.action_controller.javascripts_dir

no docs for action_controller.javascripts_dir found in rails guides

"/Users/schneems/Documents/projects/codetriage/public/javascripts"

config.action_controller.stylesheets_dir

no docs for action_controller.stylesheets_dir found in rails guides

"/Users/schneems/Documents/projects/codetriage/public/stylesheets"

config.action_controller.asset_host

  • config.asset_host sets the host for the assets. Useful when CDNs are used for hosting assets, or when you want to work around the concurrency constraints builtin in browsers using different domain aliases. Shorter version of config.action_controller.asset_host.
nil

config.action_controller.relative_url_root

  • config.action_controller.relative_url_root can be used to tell Rails that you are deploying to a subdirectory. The default is ENV['RAILS_RELATIVE_URL_ROOT'].
nil

config.active_record.maintain_test_schema

  • config.active_record.maintain_test_schema is a boolean value which controls whether Active Record should try to keep your test database schema up-to-date with db/schema.rb (or db/structure.sql) when you run your tests. The default is true.
true

config.action_mailer.raise_delivery_errors

  • config.action_mailer.raise_delivery_errors specifies whether to raise an error if email delivery cannot be completed. It defaults to true.
false

config.action_mailer.default_url_options.host

no docs for action_mailer.default_url_options.host found in rails guides

"localhost:5000"

config.action_mailer.assets_dir

no docs for action_mailer.assets_dir found in rails guides

"/Users/schneems/Documents/projects/codetriage/public"

config.action_mailer.javascripts_dir

no docs for action_mailer.javascripts_dir found in rails guides

"/Users/schneems/Documents/projects/codetriage/public/javascripts"

config.action_mailer.stylesheets_dir

no docs for action_mailer.stylesheets_dir found in rails guides

"/Users/schneems/Documents/projects/codetriage/public/stylesheets"

config.action_mailer.preview_path

no docs for action_mailer.preview_path found in rails guides

"/Users/schneems/Documents/projects/codetriage/test/mailers/previews"

config.action_mailer.asset_host

no docs for action_mailer.asset_host found in rails guides

nil

config.action_mailer.relative_url_root

no docs for action_mailer.relative_url_root found in rails guides

nil

config.assets._blocks

no docs for assets._blocks found in rails guides

[]

config.assets.paths

  • config.assets.paths contains the paths which are used to look for assets. Appending paths to this configuration option will cause those paths to be used in the search for assets.
["/Users/schneems/Documents/projects/codetriage/app/assets/images", "/Users/schneems/Documents/projects/codetriage/app/assets/javascripts", "/Users/schneems/Documents/projects/codetriage/app/assets/stylesheets", "/Users/schneems/Documents/projects/codetriage/vendor/assets/javascripts", "/Users/schneems/Documents/projects/codetriage/vendor/assets/stylesheets", "/Users/schneems/.gem/ruby/2.1.2/gems/teaspoon-0.7.4/app/assets/javascripts", "/Users/schneems/.gem/ruby/2.1.2/gems/teaspoon-0.7.4/app/assets/stylesheets", "/Users/schneems/.gem/ruby/2.1.2/gems/teaspoon-0.7.4/vendor/assets/javascripts", "/Users/schneems/.gem/ruby/2.1.2/gems/jquery-rails-3.0.4/vendor/assets/javascripts", "/Users/schneems/Documents/projects/codetriage/test/javascript", "/Users/schneems/Documents/projects/codetriage/test/javascript/stylesheets"]

config.assets.prefix

  • config.assets.prefix defines the prefix where assets are served from. Defaults to /assets.
"/assets"

config.assets.precompile

  • config.assets.precompile allows you to specify additional assets (other than application.css and application.js) which are to be precompiled when rake assets:precompile is run.
[#<Proc:0x007f8db51234d8@/Users/schneems/.gem/ruby/2.1.2/gems/sprockets-rails-2.0.1/lib/sprockets/railtie.rb:39 (lambda)>, /(?:\/|\\|\A)application\.(css|js)$/]

config.assets.version

  • config.assets.version is an option string that is used in MD5 hash generation. This can be changed to force all files to be recompiled.
""

config.assets.debug

  • config.assets.debug disables the concatenation and compression of assets. Set to true by default in development.rb.
true

config.assets.compile

  • config.assets.compile is a boolean that can be used to turn on live Sprockets compilation in production.
true

config.assets.digest

  • config.assets.digest enables the use of MD5 fingerprints in asset names. Set to true by default in production.rb.
false

config.assets.enabled

  • config.assets.enabled a flag that controls whether the asset pipeline is enabled. It is set to true by default.
true

config.assets.initialize_on_precompile

no docs for assets.initialize_on_precompile found in rails guides

false

config.assets.compress

  • config.assets.compress a flag that enables the compression of compiled assets. It is explicitly set to true in config/environments/production.rb.
false

config.assets.raise_production_errors

no docs for assets.raise_production_errors found in rails guides

true

config.assets.logger

  • config.assets.logger accepts a logger conforming to the interface of Log4r or the default Ruby Logger class. Defaults to the same configured at config.logger. Setting config.assets.logger to false will turn off served assets logging.

Configuring Generators

Rails allows you to alter what generators are used with the config.generators method. This method takes a block:

config.generators do |g|
  g.orm :active_record
  g.test_framework :test_unit
end

The full set of methods that can be used in this block are as follows:

false

config.skylight.environments

no docs for skylight.environments found in rails guides

["production"]

config.skylight.config_path

no docs for skylight.config_path found in rails guides

"config/skylight.yml"

config.devise

no docs for devise found in rails guides

Devise

config.quiet_assets

no docs for quiet_assets found in rails guides

true

config.cache_store

  • config.cache_store configures which cache store to use for Rails caching. Options include one of the symbols :memory_store, :file_store, :mem_cache_store, :null_store, or an object that implements the cache API. Defaults to :file_store if the directory tmp/cache exists, and to :memory_store otherwise.
:dalli_store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment