aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/configuring.md
diff options
context:
space:
mode:
authorMehmet Emin İNAÇ <mehmetemininac@gmail.com>2016-03-05 06:25:20 +0200
committerMehmet Emin İNAÇ <mehmetemininac@gmail.com>2016-03-05 22:42:14 +0200
commit325ccb150c1fe28ccf4ebfc50e7bc17c0cc6bffa (patch)
tree1b38aedafc120ec9dce53fddb31e633c903d45f7 /guides/source/configuring.md
parentddf4c953ae8d10489e0bfd6008bd76395f6e1267 (diff)
downloadrails-325ccb150c1fe28ccf4ebfc50e7bc17c0cc6bffa.tar.gz
rails-325ccb150c1fe28ccf4ebfc50e7bc17c0cc6bffa.tar.bz2
rails-325ccb150c1fe28ccf4ebfc50e7bc17c0cc6bffa.zip
Added some useful configuration options into configuring.md [ci skip]
Added information about inserting middlewares with indexes. I think this information useful. We can use indexes also for `insert_after` but the behavior is not same and this is not the right place to give full information about all configuration options. The configuration for I18n fallbacks is important for production environment. Especially using different fallbacks for different locales.
Diffstat (limited to 'guides/source/configuring.md')
-rw-r--r--guides/source/configuring.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index d3a87c3820..206670fa55 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -230,6 +230,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
@@ -260,6 +266,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: