Forum: Ruby on Rails `ActionController::Base#render :nothing => true` still whine

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7b69f9b73f8c078ef52ffa50a0c57ffc?d=identicon&s=25 Chris Pearl (Guest)
on 2007-01-09 03:59
(Received via mailing list)
In FooController, I put method #bar whose only purpose is to run some
logic in the background and return a status 204 [1].

So in order to return only the 204 status code, I put at the end of
#bar:

`render :nothing => true, :status => 204`

But then when surfing to /foo/bar, I get an error about "missing
template bar.rhtml". Is this a bug?

(The solution eventually was `render :text => ''`, but it really seems
like a hack and that `render => :nothing` should have been the valid
solution)

-Chris

[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html - "204 No
Content: The server has fulfilled the request but does not need to
return an entity-body"
This topic is locked and can not be replied to.