Skip to content

Commit

Permalink
More consistent use of 'an' in front of 'h'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Scherer committed Feb 11, 2009
1 parent 36f33ef commit a088848
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions railties/guides/source/layouts_and_rendering.textile
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ end

h4. Using redirect_to

Another way to handle returning responses to a HTTP request is with +redirect_to+. As you've seen, +render+ tells Rails which view (or other asset) to use in constructing a response. The +redirect_to+ method does something completely different: it tells the browser to send a new request for a different URL. For example, you could redirect from wherever you are in your code to the index of photos in your application with this call:
Another way to handle returning responses to an HTTP request is with +redirect_to+. As you've seen, +render+ tells Rails which view (or other asset) to use in constructing a response. The +redirect_to+ method does something completely different: it tells the browser to send a new request for a different URL. For example, you could redirect from wherever you are in your code to the index of photos in your application with this call:

<ruby>
redirect_to photos_path
Expand All @@ -443,7 +443,7 @@ Just like the +:status+ option for +render+, +:status+ for +redirect_to+ accepts

h5. The Difference Between render and redirect

Sometimes inexperienced developers conceive of +redirect_to+ as a sort of +goto+ command, moving execution from one place to another in your Rails code. This is _not_ correct. Your code stops running and waits for a new request for the browser. It just happens that you've told the browser what request it should make next, by sending back a HTTP 302 status code.
Sometimes inexperienced developers conceive of +redirect_to+ as a sort of +goto+ command, moving execution from one place to another in your Rails code. This is _not_ correct. Your code stops running and waits for a new request for the browser. It just happens that you've told the browser what request it should make next, by sending back an HTTP 302 status code.

Consider these actions to see the difference:

Expand Down

0 comments on commit a088848

Please sign in to comment.