aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2015-05-28 09:23:51 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2015-05-28 09:23:51 -0300
commit172e452e0a0147701d08b85573fbabe22f2d9274 (patch)
treedf1d43df102bb584ac8a10891cb546862516b403 /guides
parent207f8fc7debec1e9173f797e5208527e97235af3 (diff)
parent44781b6e9790d90b4f8b9a41d2b2c114b1a582ee (diff)
downloadrails-172e452e0a0147701d08b85573fbabe22f2d9274.tar.gz
rails-172e452e0a0147701d08b85573fbabe22f2d9274.tar.bz2
rails-172e452e0a0147701d08b85573fbabe22f2d9274.zip
Merge pull request #20336 from vngrs/deprecate_nothing_option_for_render_method
Deprecate `:nothing` option for render method
Diffstat (limited to 'guides')
-rw-r--r--guides/source/layouts_and_rendering.md26
1 files changed, 0 insertions, 26 deletions
diff --git a/guides/source/layouts_and_rendering.md b/guides/source/layouts_and_rendering.md
index 737f392995..94cd7297e2 100644
--- a/guides/source/layouts_and_rendering.md
+++ b/guides/source/layouts_and_rendering.md
@@ -103,32 +103,6 @@ In most cases, the `ActionController::Base#render` method does the heavy lifting
TIP: If you want to see the exact results of a call to `render` without needing to inspect it in a browser, you can call `render_to_string`. This method takes exactly the same options as `render`, but it returns a string instead of sending a response back to the browser.
-#### Rendering Nothing
-
-Perhaps the simplest thing you can do with `render` is to render nothing at all:
-
-```ruby
-render nothing: true
-```
-
-If you look at the response for this using cURL, you will see the following:
-
-```bash
-$ curl -i 127.0.0.1:3000/books
-HTTP/1.1 200 OK
-Connection: close
-Date: Sun, 24 Jan 2010 09:25:18 GMT
-Transfer-Encoding: chunked
-Content-Type: */*; charset=utf-8
-X-Runtime: 0.014297
-Set-Cookie: _blog_session=...snip...; path=/; HttpOnly
-Cache-Control: no-cache
-```
-
-We see there is an empty response (no data after the `Cache-Control` line), but the request was successful because Rails has set the response to 200 OK. You can set the `:status` option on render to change this response. Rendering nothing can be useful for Ajax requests where all you want to send back to the browser is an acknowledgment that the request was completed.
-
-TIP: You should probably be using the `head` method, discussed later in this guide, instead of `render :nothing`. This provides additional flexibility and makes it explicit that you're only generating HTTP headers.
-
#### Rendering an Action's View
If you want to render the view that corresponds to a different template within the same controller, you can use `render` with the name of the view: