Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update routing.md #19605

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions guides/source/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,18 @@ As long as `Sprockets` responds to `call` and returns a `[status, headers, body]

NOTE: For the curious, `'articles#index'` actually expands out to `ArticlesController.action(:index)`, which returns a valid Rack application.

If you specify a rack application as the endpoint for a matcher remember that the route will be unchanged in the receiving application. With the following route your rack application should expect the route to be '/admin':

```ruby
match '/admin', to: AdminApp, via: :all
```

If you would prefer to have your rack application receive requests at the root path instead use mount:

```ruby
mount AdminApp, at: '/admin'
```

### Using `root`

You can specify what Rails should route `'/'` to with the `root` method:
Expand Down