diff options
author | Carl Lerche <carllerche@mac.com> | 2009-03-20 16:50:51 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-03-23 10:23:14 -0700 |
commit | c6123c37030b715d088860ea1ca79060659b0e3c (patch) | |
tree | 36da3c375333660c0ff41dcf113dfdf3f82c9bde /actionpack/lib/action_controller/abstract/renderer.rb | |
parent | 81e814adfad6d4bba1af5f70a5a409f6d71f8f6c (diff) | |
download | rails-c6123c37030b715d088860ea1ca79060659b0e3c.tar.gz rails-c6123c37030b715d088860ea1ca79060659b0e3c.tar.bz2 rails-c6123c37030b715d088860ea1ca79060659b0e3c.zip |
Finished implementing layout for render :text
Diffstat (limited to 'actionpack/lib/action_controller/abstract/renderer.rb')
-rw-r--r-- | actionpack/lib/action_controller/abstract/renderer.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/abstract/renderer.rb b/actionpack/lib/action_controller/abstract/renderer.rb index d95158be42..5daade6109 100644 --- a/actionpack/lib/action_controller/abstract/renderer.rb +++ b/actionpack/lib/action_controller/abstract/renderer.rb @@ -20,8 +20,8 @@ module AbstractController @_action_view ||= ActionView::Base.new(self.class.view_paths, {}, self) end - def render(name = action_name, options = {}) - self.response_body = render_to_string(name, options) + def render(options = {}) + self.response_body = render_to_string(options) end # Raw rendering of a template. @@ -30,7 +30,9 @@ module AbstractController # @option _layout<String> The relative path to the layout template to use # # :api: plugin - def render_to_string(name = action_name, options = {}) + def render_to_string(options = {}) + name = options[:_template_name] || action_name + template = options[:_template] || view_paths.find_by_parts(name.to_s, formats, options[:_prefix]) _render_template(template, options) end |