template bar.rhtml". Is this a bug?
It’s hard to know without seeing a code sample. Perhaps your render call
is
lurking within a conditional?
Note that in 1.2 you can do “head 204” or “head :no_content” when you
have
nothing to render and just want to return a status and optional headers.
The symbolic status code is translated to 204 No Content (likewise for
head
:forbidden, head :whatever_status_code, etc.)
template bar.rhtml". Is this a bug?
It’s hard to know without seeing a code sample. Perhaps your render call
is
lurking within a conditional?
I’ve checked again and the problem was with the way my testing browser
(FF 1.5.0.9 on Win32) interacted with the content-less response.
Probably because there was nothing to render, the browser simply
redisplayed the last rendered content, which happened to be the said
warning about missing template.
Rendering an empty string “fixed” this because the browser would then
display a blank page. My conusing was exacerbated by an additional
browser quirk: trying to refresh the page resulted in the browser
silently resending the last rendered request, i.e. the one which
emitted the “template missing” warning, instead of resending the request
that returned the blank 204.
Note that in 1.2 you can do “head 204” or “head :no_content” when you
have
nothing to render and just want to return a status and optional headers.
The symbolic status code is translated to 204 No Content (likewise for
head
:forbidden, head :whatever_status_code, etc.)
Thanks for all the information about 1.2. Not sure how much of an
improvement head is over render :nothing => true, which is nice
enough imho. However, being able to use symbolic status codes is
definitely a nifty feature!
-Chris
jeremy
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.