diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-02-12 22:42:36 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-02-12 22:42:36 +0000 |
commit | 46356100d1518c67d005be1fecceb9aea4c72dfd (patch) | |
tree | 3be4b7579fe95c45929d3135ea370493519c8c01 /actionpack/lib/action_controller/base.rb | |
parent | 11787b802a1ea8152507e94940f9af394d343c4c (diff) | |
download | rails-46356100d1518c67d005be1fecceb9aea4c72dfd.tar.gz rails-46356100d1518c67d005be1fecceb9aea4c72dfd.tar.bz2 rails-46356100d1518c67d005be1fecceb9aea4c72dfd.zip |
Make sure render :update support the options hash. Closes #11088 [ernesto.jimenez]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/base.rb')
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 34c3ed3a60..7dd449d8a5 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -834,14 +834,16 @@ module ActionController #:nodoc: # All renders take the :status and :location options and turn them into headers. They can even be used together: # # render :xml => post.to_xml, :status => :created, :location => post_url(post) - def render(options = nil, &block) #:doc: + def render(options = nil, extra_options = {}, &block) #:doc: raise DoubleRenderError, "Can only render or redirect once per action" if performed? if options.nil? return render_for_file(default_template_name, nil, true) + elsif !extra_options.is_a?(Hash) + raise RenderError, "You called render with invalid options : #{options}, #{extra_options}" else if options == :update - options = { :update => true } + options = extra_options.merge({ :update => true }) elsif !options.is_a?(Hash) raise RenderError, "You called render with invalid options : #{options}" end @@ -910,7 +912,7 @@ module ActionController #:nodoc: generator = ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.new(@template, &block) response.content_type = Mime::JS - render_for_text(generator.to_s) + render_for_text(generator.to_s, options[:status]) elsif options[:nothing] # Safari doesn't pass the headers of the return if the response is zero length |