提交 8d2487d9 编写于 作者: A Alexey Vakhov

Fix redirect with block example

上级 86b30c43
......@@ -67,10 +67,10 @@ module Redirection
# params, depending of how many arguments your block accepts. A string is required as a
# return value.
#
# match 'jokes/:number', :to => redirect do |params, request|
# match 'jokes/:number', :to => redirect { |params, request|
# path = (params[:number].to_i.even? ? "/wheres-the-beef" : "/i-love-lamp")
# "http://#{request.host_with_port}/#{path}"
# end
# "http://#{request.host_with_port}#{path}"
# }
#
# The options version of redirect allows you to supply only the parts of the url which need
# to change, it also supports interpolation of the path similar to the first example.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册