提交 3738ef29 编写于 作者: C Cesar Carruitero

correct double quotes for interpolation in routing guide [ci_skip]

上级 5fe385ba
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册