From 4c52ba278b8e349bc18cb89086af765d0828f0af Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 21 May 2009 20:22:18 -0700 Subject: Move Safari response-padding fix to Rails2Compatibility. Should be a Rack concern. --- actionpack/lib/action_controller/new_base/base.rb | 8 ++------ actionpack/lib/action_controller/new_base/compatibility.rb | 6 ++++-- actionpack/lib/action_controller/new_base/renderer.rb | 13 ++----------- actionpack/lib/action_controller/new_base/testing.rb | 4 ++-- 4 files changed, 10 insertions(+), 21 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/new_base/base.rb b/actionpack/lib/action_controller/new_base/base.rb index fae08c58b2..88686d29d0 100644 --- a/actionpack/lib/action_controller/new_base/base.rb +++ b/actionpack/lib/action_controller/new_base/base.rb @@ -110,11 +110,7 @@ module ActionController options = _normalize_options(action, options, &blk) super(options) end - - def render_to_body(options) - super || [" "] - end - + # Redirects the browser to the target specified in +options+. This parameter can take one of three forms: # # * Hash - The URL will be generated by calling url_for with the +options+. @@ -172,4 +168,4 @@ module ActionController super(url, status) end end -end \ No newline at end of file +end diff --git a/actionpack/lib/action_controller/new_base/compatibility.rb b/actionpack/lib/action_controller/new_base/compatibility.rb index 522a9fe23b..250e7f0dff 100644 --- a/actionpack/lib/action_controller/new_base/compatibility.rb +++ b/actionpack/lib/action_controller/new_base/compatibility.rb @@ -91,7 +91,9 @@ module ActionController options[:text] = nil if options[:nothing] == true - super + body = super + body = [' '] if body.blank? + body end def _handle_method_missing @@ -110,4 +112,4 @@ module ActionController response_body end end -end \ No newline at end of file +end diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb index 71b79fbc42..59df3c51da 100644 --- a/actionpack/lib/action_controller/new_base/renderer.rb +++ b/actionpack/lib/action_controller/new_base/renderer.rb @@ -28,7 +28,7 @@ module ActionController _process_options(options) if options.key?(:text) - options[:_template] = ActionView::TextTemplate.new(_text(options), formats.first) + options[:_template] = ActionView::TextTemplate.new(options[:text], formats.first) elsif options.key?(:inline) handler = ActionView::Template.handler_class_for_extension(options[:type] || "erb") template = ActionView::Template.new(options[:inline], "inline #{options[:inline].inspect}", handler, {}) @@ -51,17 +51,8 @@ module ActionController def _prefix controller_path - end - - def _text(options) - text = options[:text] - - case text - when nil then " " - else text.to_s - end end - + def _render_partial(partial, options) case partial when true diff --git a/actionpack/lib/action_controller/new_base/testing.rb b/actionpack/lib/action_controller/new_base/testing.rb index 6a92c292bd..d8c3421587 100644 --- a/actionpack/lib/action_controller/new_base/testing.rb +++ b/actionpack/lib/action_controller/new_base/testing.rb @@ -7,7 +7,7 @@ module ActionController @_response = response @_response.request = request ret = process(request.parameters[:action]) - @_response.body ||= self.response_body || " " + @_response.body ||= self.response_body @_response.prepare! set_test_assigns ret @@ -27,4 +27,4 @@ module ActionController @_response.headers.replace(new_headers) end end -end \ No newline at end of file +end -- cgit v1.2.3