diff options
-rw-r--r-- | guides/source/routing.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/routing.md b/guides/source/routing.md index dce45b95b8..53f037c25b 100644 --- a/guides/source/routing.md +++ b/guides/source/routing.md @@ -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. |