Skip to content

Commit

Permalink
correct double quotes for interpolation in routing guide [ci_skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
ccarruitero committed Nov 8, 2012
1 parent 5fe385b commit 3738ef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guides/source/routing.md
Expand Up @@ -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.
Expand Down

0 comments on commit 3738ef2

Please sign in to comment.