Skip to content
This repository
Browse code

Adding documentation to redirect_to and status code option references

  • Loading branch information...
commit 597fb1da948b923e608324bc54b04af85b638619 1 parent c6e33d3
Mikel Lindsaar authored September 09, 2010

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  actionpack/lib/action_controller/base.rb
6  actionpack/lib/action_controller/base.rb
@@ -1088,6 +1088,9 @@ def default_url_options(options = nil)
1088 1088
       #   redirect_to post_url(@post), :status => 301
1089 1089
       #   redirect_to :action=>'atom', :status => 302
1090 1090
       #
  1091
+      # The status code can either be a standard {HTTP Status code}[http://www.iana.org/assignments/http-status-codes] as an 
  1092
+      # integer, or a symbol representing the downcased, underscored and symbolized description.
  1093
+      #
1091 1094
       # It is also possible to assign a flash message as part of the redirection. There are two special accessors for commonly used the flash names
1092 1095
       # +alert+ and +notice+ as well as a general purpose +flash+ bucket.
1093 1096
       #
@@ -1097,8 +1100,7 @@ def default_url_options(options = nil)
1097 1100
       #   redirect_to post_url(@post), :status => 301, :flash => { :updated_post_id => @post.id }
1098 1101
       #   redirect_to { :action=>'atom' }, :alert => "Something serious happened"
1099 1102
       #
1100  
-      # When using <tt>redirect_to :back</tt>, if there is no referrer,
1101  
-      # RedirectBackError will be raised. You may specify some fallback
  1103
+      # When using <tt>redirect_to :back</tt>, if there is no referrer, RedirectBackError will be raised. You may specify some fallback
1102 1104
       # behavior for this case by rescuing RedirectBackError.
1103 1105
       def redirect_to(options = {}, response_status = {}) #:doc:
1104 1106
         raise ActionControllerError.new("Cannot redirect to nil!") if options.nil?

0 notes on commit 597fb1d

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