Re: render :update, :status => 500

Matt Palmer
Wed, 12 Sep 2007 21:59:20 -0000

On Wed, Sep 12, 2007 at 06:04:11PM -0000, Matt Zukowski
wrote:
> Is there a reason why render :update does not take the :status
> parameter as most other forms of render do?
>
> Unless I''m missing something, looking at ActionController::Base,
this
> should be as easy to fix as:
>
> line 770 in actionpack-1.13.3/lib/actioncontroller/base.rb:
>
>   render_javascript(generator.to_s)
>
> becomes...
>
>   render_javascript(generator.to_s, options[:status])
>
>
> This is too easy, so there must be a good reason why it was explicitly
> left out, right?

Don''t bet.  We all make mistakes, and let''s be honest -- the
number of times
anyone''s going to want to render an RJS template when giving a non-OK
status
definitely sits in very close proximity to "never".  So it
wouldn''t surprise
me if it got missed in the shuffle, and nobody''s noticed before because
it''s
a very uncommon thing to want to do.

On the other hand, it may have been left off on purpose because nobody could
imagine why someone would want to send JavaScript with a non-OK status code,
but if you''ve got a legitimate reason for wanting to do it, I cannot
see why
a patch wouldn''t be accepted to allow it.

- Matt
(Oooh, bricktext!)

--
I can only guess that the designer of the things had a major Toilet Duck
habit and had managed to score a couple of industrial-sized bottles of the
stuff the night before.
		-- Tanuki