Skip to content

Commit a7c68d4

Browse files
authored
Merge pull request rails#51032 from DoodlingDev/layout-and-rendering-in-rails--redirect-to-disambiguation
Disambiguate language around when controller code stops re: `redirect_to` [ci skip]
2 parents 931c5ef + 3800949 commit a7c68d4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

guides/source/layouts_and_rendering.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,14 @@ Just like the `:status` option for `render`, `:status` for `redirect_to` accepts
714714
715715
#### The Difference Between `render` and `redirect_to`
716716
717-
Sometimes inexperienced developers think 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 from 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.
717+
Sometimes inexperienced developers think of `redirect_to` as a sort of `goto`
718+
command, moving execution from one place to another in your Rails code. This is
719+
_not_ correct.
720+
721+
The current action will complete, returning a response to the browser. After
722+
this your code stops running and waits for a new request, it just happens that
723+
you've told the browser what request it should make next by sending back an
724+
HTTP 302 status code.
718725

719726
Consider these actions to see the difference:
720727

0 commit comments

Comments
 (0)