aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2014-12-22 21:30:09 -0700
committerSean Griffin <sean@seantheprogrammer.com>2014-12-22 21:30:09 -0700
commit38e9f5b1d80018cb32b918f7ddd0ec677e79dfd2 (patch)
tree5368684c735cdfda02239487e9efd1825aa991bc
parentd9d865aa40b29b4b5aba71e9f6108eaab7206b1e (diff)
parent2ad466b867844d405110d1862cf020848f7a1814 (diff)
downloadrails-38e9f5b1d80018cb32b918f7ddd0ec677e79dfd2.tar.gz
rails-38e9f5b1d80018cb32b918f7ddd0ec677e79dfd2.tar.bz2
rails-38e9f5b1d80018cb32b918f7ddd0ec677e79dfd2.zip
Merge pull request #18158 from YayConnolly/master
Describe gotcha for 'status' option [ci skip]
-rw-r--r--guides/source/layouts_and_rendering.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md
index 28fa61a964..8ef7967ff1 100644
--- a/guides/source/layouts_and_rendering.md
+++ b/guides/source/layouts_and_rendering.md
@@ -425,6 +425,9 @@ Rails understands both numeric status codes and the corresponding symbols shown
| | 510 | :not_extended |
| | 511 | :network_authentication_required |
+NOTE: If you try to render content along with a non-content status code
+(100-199, 204, 205 or 304), it will be dropped from the response.
+
#### Finding Layouts
To find the current layout, Rails first looks for a file in `app/views/layouts` with the same base name as the controller. For example, rendering actions from the `PhotosController` class will use `app/views/layouts/photos.html.erb` (or `app/views/layouts/photos.builder`). If there is no such controller-specific layout, Rails will use `app/views/layouts/application.html.erb` or `app/views/layouts/application.builder`. If there is no `.erb` layout, Rails will use a `.builder` layout if one exists. Rails also provides several ways to more precisely assign specific layouts to individual controllers and actions.