Permalink
Browse files

Rename render_to_string to render_to_body since it may return any Rac…

…k-compatible body, not just strings
  • Loading branch information...
jeremy committed Apr 17, 2009
1 parent ecdc064 commit df42d26f990cd013c8d80505a9a92537fbcaa4bf
@@ -17,7 +17,7 @@ def _action_view
end
def render(options = {})
- self.response_body = render_to_string(options)
+ self.response_body = render_to_body(options)
end
# Raw rendering of a template.
@@ -26,7 +26,7 @@ def render(options = {})
# @option _layout<String> The relative path to the layout template to use
#
# :api: plugin
- def render_to_string(options = {})
+ def render_to_body(options = {})
name = options[:_template_name] || action_name
template = options[:_template] || view_paths.find_by_parts(name.to_s, formats, options[:_prefix])
@@ -55,4 +55,4 @@ def view_paths=(paths)
end
end
end
-end
+end
@@ -58,4 +58,4 @@ def to_rack
response.to_a
end
end
-end
+end
@@ -9,7 +9,7 @@ def _implied_layout_name
end
end
- def render_to_string(options)
+ def render_to_body(options)
# render :text => ..., :layout => ...
# or
# render :anything_else
@@ -34,4 +34,4 @@ def _layout_for_option(name)
end
end
-end
+end
@@ -8,7 +8,7 @@ def initialize(*)
end
def render(action, options = {})
- # TODO: Move this into #render_to_string
+ # TODO: Move this into #render_to_body
if action.is_a?(Hash)
options, action = action, nil
else
@@ -17,10 +17,10 @@ def render(action, options = {})
_process_options(options)
- self.response_body = render_to_string(options)
+ self.response_body = render_to_body(options)
end
- def render_to_string(options)
+ def render_to_body(options)
unless options.is_a?(Hash)
options = {:action => options}
end
@@ -59,4 +59,4 @@ def _process_options(options)
end
end
end
-end
+end
@@ -134,7 +134,7 @@ def _layout
self.class.layout(formats)
end
- def render_to_string(options = {})
+ def render_to_body(options = {})
options[:_layout] = options[:layout] || _layout
super
end
@@ -223,4 +223,4 @@ def assert_dispatch(klass, body = "success", action = :index)
end
end
-end
+end
@@ -23,7 +23,7 @@ def self.controller_path
def controller_path() self.class.controller_path end
- def render_to_string(options)
+ def render_to_body(options)
options[:_layout] = _default_layout
super
end
@@ -229,4 +229,4 @@ class ::BadOmgFailLolLayout < AbstractControllerTests::Layouts::Base
end
end
end
-end
+end

0 comments on commit df42d26

Please sign in to comment.