diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2010-11-27 08:29:29 +1100 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2010-11-27 08:29:29 +1100 |
commit | c8c95fc519f9d0e23e012d4434e6c3fe0f6e2a62 (patch) | |
tree | 52805997a6fefe10af85d8357707a6d83f2a3bf9 /railties/guides/source/configuring.textile | |
parent | 3ee0f0379cc0ae3dd44a050e35d644f1ad7a920b (diff) | |
download | rails-c8c95fc519f9d0e23e012d4434e6c3fe0f6e2a62.tar.gz rails-c8c95fc519f9d0e23e012d4434e6c3fe0f6e2a62.tar.bz2 rails-c8c95fc519f9d0e23e012d4434e6c3fe0f6e2a62.zip |
Add methods for configuring middleware to config guide
Diffstat (limited to 'railties/guides/source/configuring.textile')
-rw-r--r-- | railties/guides/source/configuring.textile | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile index 8187c647dd..ca78cc0e6d 100644 --- a/railties/guides/source/configuring.textile +++ b/railties/guides/source/configuring.textile @@ -132,6 +132,29 @@ Every Rails application comes with a standard set of middleware which it uses in * +ActionDispatch::Head+ converts HEAD requests to GET requests and serves them as so. * +ActionDispatch::BestStandardsSupport+ enables "best standards support" so that IE8 renders some elements correctly. +Besides these usual middleware, you can add your own by using the +config.middleware.use+ method: + +<ruby> + config.middleware.use Magical::Unicorns +</ruby> + +This will put the +Magical::Unicorns+ middleware on the end of the stack. If you wish to put this middleware before another use +insert_before+: + +<ruby> + config.middleware.insert_before ActionDispatch::Head, Magical::Unicorns +</ruby> + +There's also +insert_after+ which will insert a middleware _after_ another: + +<ruby> + config.middleware.insert_after ActionDispatch::Head, Magical::Unicorns +</ruby> + +Middlewares can also be completely swapped out and replaced with others: + +<ruby> + config.middleware.swap ActionDispatch::BestStandardsSupport, Magical::Unicorns +</ruby> h4. Configuring i18n |