mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
correct double quotes for interpolation in routing guide [ci_skip]
This commit is contained in:
parent
5fe385ba93
commit
3738ef292a
1 changed files with 2 additions and 2 deletions
|
@ -668,8 +668,8 @@ get '/stories/:name', to: redirect('/posts/%{name}')
|
|||
You can also provide a block to redirect, which receives the params and the request object:
|
||||
|
||||
```ruby
|
||||
get '/stories/:name', to: redirect {|params, req| '/posts/#{params[:name].pluralize}' }
|
||||
get '/stories', to: redirect {|p, req| '/posts/#{req.subdomain}' }
|
||||
get '/stories/:name', to: redirect {|params, req| "/posts/#{params[:name].pluralize}" }
|
||||
get '/stories', to: redirect {|p, req| "/posts/#{req.subdomain}" }
|
||||
```
|
||||
|
||||
Please note that this redirection is a 301 "Moved Permanently" redirect. Keep in mind that some web browsers or proxy servers will cache this type of redirect, making the old page inaccessible.
|
||||
|
|
Loading…
Reference in a new issue