From 0fc481d7c834ae905ebb2e52f47c3c3656ebd1c9 Mon Sep 17 00:00:00 2001 From: danielc192 Date: Thu, 16 Jul 2009 12:53:29 -0700 Subject: The redirect_to method in ActionController supports the :params option, however this is not mentioned in the documentation. This commit adds this. It includes an example and a brief description of the :params option. --- actionpack/lib/action_controller/base/base.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/actionpack/lib/action_controller/base/base.rb b/actionpack/lib/action_controller/base/base.rb index e541d24e31..7bed86a77b 100644 --- a/actionpack/lib/action_controller/base/base.rb +++ b/actionpack/lib/action_controller/base/base.rb @@ -114,6 +114,8 @@ module ActionController # * String starting with protocol:// (like http://) - Is passed straight through as the target for redirection. # * String not containing a protocol - The current protocol and host is prepended to the string. # * :back - Back to the page that issued the request. Useful for forms that are triggered from multiple places. + # * :params - A hash containing the parameters to be passed as a GET request + # # Short-hand for redirect_to(request.env["HTTP_REFERER"]) # # Examples: @@ -123,6 +125,7 @@ module ActionController # redirect_to "/images/screenshot.jpg" # redirect_to articles_url # redirect_to :back + # redirect_to articles_url, :params => {"name" => "Ruby"} # # The redirection happens as a "302 Moved" header unless otherwise specified. # -- cgit v1.2.3