Skip to content
This repository
Browse code

Fix redirect with block example

  • Loading branch information...
commit 8d2487d9d458914bebb83fc74a6957f56dc0a8b5 1 parent 86b30c4
Alexey Vakhov authored April 17, 2012
6  actionpack/lib/action_dispatch/routing/redirection.rb
@@ -67,10 +67,10 @@ module Redirection
67 67
       # params, depending of how many arguments your block accepts. A string is required as a
68 68
       # return value.
69 69
       #
70  
-      #   match 'jokes/:number', :to => redirect do |params, request|
  70
+      #   match 'jokes/:number', :to => redirect { |params, request|
71 71
       #     path = (params[:number].to_i.even? ? "/wheres-the-beef" : "/i-love-lamp")
72  
-      #     "http://#{request.host_with_port}/#{path}"
73  
-      #   end
  72
+      #     "http://#{request.host_with_port}#{path}"
  73
+      #   }
74 74
       #
75 75
       # The options version of redirect allows you to supply only the parts of the url which need
76 76
       # to change, it also supports interpolation of the path similar to the first example.

0 notes on commit 8d2487d

Please sign in to comment.
Something went wrong with that request. Please try again.