aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-21 20:22:18 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-21 20:27:24 -0700
commit4c52ba278b8e349bc18cb89086af765d0828f0af (patch)
tree5b06e9a44f696f009c350281891062643620e00c /actionpack/lib/action_controller/new_base
parent8f3cbb477375071cfa2ca9b3b01d8a4e3034ccf5 (diff)
downloadrails-4c52ba278b8e349bc18cb89086af765d0828f0af.tar.gz
rails-4c52ba278b8e349bc18cb89086af765d0828f0af.tar.bz2
rails-4c52ba278b8e349bc18cb89086af765d0828f0af.zip
Move Safari response-padding fix to Rails2Compatibility. Should be a Rack concern.
Diffstat (limited to 'actionpack/lib/action_controller/new_base')
-rw-r--r--actionpack/lib/action_controller/new_base/base.rb8
-rw-r--r--actionpack/lib/action_controller/new_base/compatibility.rb6
-rw-r--r--actionpack/lib/action_controller/new_base/renderer.rb13
-rw-r--r--actionpack/lib/action_controller/new_base/testing.rb4
4 files changed, 10 insertions, 21 deletions
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:
#
# * <tt>Hash</tt> - 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