diff options
author | Vipul A M <vipulnsward@gmail.com> | 2016-06-05 10:30:47 -0700 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2016-06-05 10:30:47 -0700 |
commit | 95ef0be951a24d50e16b5f5ceeeba584f9d4f18e (patch) | |
tree | 8dbea1befd15839ded222520a3b91585f30ea4c0 /guides/source | |
parent | 8fc355e2341f943f8533fbafa64a787c1633f086 (diff) | |
parent | 325ccb150c1fe28ccf4ebfc50e7bc17c0cc6bffa (diff) | |
download | rails-95ef0be951a24d50e16b5f5ceeeba584f9d4f18e.tar.gz rails-95ef0be951a24d50e16b5f5ceeeba584f9d4f18e.tar.bz2 rails-95ef0be951a24d50e16b5f5ceeeba584f9d4f18e.zip |
Merge pull request #24071 from meinac/configuring_md_docs
Added some useful configuration options into configuring.md [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/configuring.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 51a2649ec0..47b0fd1404 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -242,6 +242,12 @@ This will put the `Magical::Unicorns` middleware on the end of the stack. You ca config.middleware.insert_before Rack::Head, Magical::Unicorns ``` +Or you can insert a middleware to exact position by using indexes. For example, if you want to insert `Magical::Unicorns` middleware on top of the stack, you can do it, like so: + +```ruby +config.middleware.insert_before 0, Magical::Unicorns +``` + There's also `insert_after` which will insert a middleware after another: ```ruby @@ -272,6 +278,26 @@ All these configuration options are delegated to the `I18n` library. * `config.i18n.load_path` sets the path Rails uses to look for locale files. Defaults to `config/locales/*.{yml,rb}`. +* `config.i18n.fallbacks` sets fallback behavior for missing translations. Here are 3 usage examples for this option: + + * You can set the option to `true` for using default locale as fallback, like so: + + ```ruby + config.i18n.fallbacks = true + ``` + + * Or you can set an array of locales as fallback, like so: + + ```ruby + config.i18n.fallbacks = [:tr, :en] + ``` + + * Or you can set different fallbacks for locales individually. For example, if you want to use `:tr` for `:az` and `:de`, `:en` for `:da` as fallbacks, you can do it, like so: + + ```ruby + config.i18n.fallbacks = { az: :tr, da: [:de, :en] } + ``` + ### Configuring Active Record `config.active_record` includes a variety of configuration options: |