1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Rename render_to_string to render_to_body since it may return any Rack-compatible body, not just strings

This commit is contained in:
Jeremy Kemper 2009-04-17 18:34:49 -05:00
parent ecdc0643f2
commit df42d26f99
6 changed files with 14 additions and 14 deletions

View file

@ -17,7 +17,7 @@ module AbstractController
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 @@ module AbstractController
# @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 @@ module AbstractController
end
end
end
end
end

View file

@ -58,4 +58,4 @@ module ActionController
response.to_a
end
end
end
end

View file

@ -9,7 +9,7 @@ module ActionController
end
end
def render_to_string(options)
def render_to_body(options)
# render :text => ..., :layout => ...
# or
# render :anything_else
@ -34,4 +34,4 @@ module ActionController
end
end
end
end

View file

@ -8,7 +8,7 @@ module ActionController
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 @@ module ActionController
_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 @@ module ActionController
end
end
end
end
end

View file

@ -134,7 +134,7 @@ module AbstractController
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 @@ module AbstractController
end
end
end
end

View file

@ -23,7 +23,7 @@ module AbstractControllerTests
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 @@ module AbstractControllerTests
end
end
end
end
end