Skip to content

Commit

Permalink
Merge pull request #46200 from patrickdavey/add_middleware_methods_to…
Browse files Browse the repository at this point in the history
…_guide [ci-skip]

Add missing middleware methods to guide
  • Loading branch information
p8 committed Oct 7, 2022
2 parents 1891a3f + 1c54862 commit d399609
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions guides/source/rails_on_rack.md
Expand Up @@ -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:
Expand Down

0 comments on commit d399609

Please sign in to comment.