From 3738ef292ac9000cf2e66e91fed61ed939daf59a Mon Sep 17 00:00:00 2001 From: Cesar Carruitero Date: Thu, 8 Nov 2012 17:16:38 -0500 Subject: [PATCH] correct double quotes for interpolation in routing guide [ci_skip] --- guides/source/routing.md | 4 ++-- 1 file 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.