Permalink
Browse files

The redirect_to method in ActionController supports the :params optio…

…n, however this is not mentioned in the documentation. This commit adds this. It includes an example and a brief description of the :params option.
  • Loading branch information...
1 parent 3032795 commit 0fc481d7c834ae905ebb2e52f47c3c3656ebd1c9 @danielc192 danielc192 committed Jul 16, 2009
Showing with 3 additions and 0 deletions.
  1. +3 −0 actionpack/lib/action_controller/base/base.rb
@@ -114,6 +114,8 @@ def render_to_string(action = nil, options = {}, &blk)
# * <tt>String</tt> starting with <tt>protocol://</tt> (like <tt>http://</tt>) - Is passed straight through as the target for redirection.
# * <tt>String</tt> not containing a protocol - The current protocol and host is prepended to the string.
# * <tt>:back</tt> - Back to the page that issued the request. Useful for forms that are triggered from multiple places.
+ # * <tt>:params</tt> - A hash containing the parameters to be passed as a GET request
+ #
# Short-hand for <tt>redirect_to(request.env["HTTP_REFERER"])</tt>
#
# Examples:
@@ -123,6 +125,7 @@ def render_to_string(action = nil, options = {}, &blk)
# 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.
#

0 comments on commit 0fc481d

Please sign in to comment.