Merge pull request #46200 from patrickdavey/add_middleware_methods_to_guide [ci-skip]

Add missing middleware methods to guide
This commit is contained in:
Petrik de Heus 2022-10-07 11:46:57 +02:00 committed by GitHub
commit d399609fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,6 +173,24 @@ You can swap an existing middleware in the middleware stack using `config.middle
config.middleware.swap ActionDispatch::ShowExceptions, Lifo::ShowExceptions
```
#### Moving a Middleware
You can move an existing middleware in the middleware stack using `config.middleware.move_before` and `config.middleware.move_after`.
```ruby
# config/application.rb
# Move ActionDispatch::ShowExceptions to before Lifo::ShowExceptions
config.middleware.move_before Lifo::ShowExceptions, ActionDispatch::ShowExceptions
```
```ruby
# config/application.rb
# Move ActionDispatch::ShowExceptions to after Lifo::ShowExceptions
config.middleware.move_after Lifo::ShowExceptions, ActionDispatch::ShowExceptions
```
#### Deleting a Middleware
Add the following lines to your application configuration: