Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

correct double quotes for interpolation in routing guide [ci_skip]

  • Loading branch information...
commit 3738ef292ac9000cf2e66e91fed61ed939daf59a 1 parent 5fe385b
@ccarruitero ccarruitero authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 guides/source/routing.md
View
4 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.
Please sign in to comment.
Something went wrong with that request. Please try again.