diff options
author | Nick Sutterer <apotonick@gmail.com> | 2011-09-22 11:54:13 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-09-22 14:12:36 +0200 |
commit | cbaad674f13067c52fa8c1a24dc498e570db4eed (patch) | |
tree | 7c1169ded5c7dbfb4f8342f6ab5735436c2cdf1a /actionpack/lib/action_view/renderer/template_renderer.rb | |
parent | 41bca5d4667a49666fc5a80bebd91f27099d1674 (diff) | |
download | rails-cbaad674f13067c52fa8c1a24dc498e570db4eed.tar.gz rails-cbaad674f13067c52fa8c1a24dc498e570db4eed.tar.bz2 rails-cbaad674f13067c52fa8c1a24dc498e570db4eed.zip |
it is now possible to pass details options (:formats, :details, :locales, ...) to #render, #find_template and friends. this doesn't change anything in global context.
Diffstat (limited to 'actionpack/lib/action_view/renderer/template_renderer.rb')
-rw-r--r-- | actionpack/lib/action_view/renderer/template_renderer.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb index d04c00fd40..0a5b470a82 100644 --- a/actionpack/lib/action_view/renderer/template_renderer.rb +++ b/actionpack/lib/action_view/renderer/template_renderer.rb @@ -15,12 +15,13 @@ module ActionView # Determine the template to be rendered using the given options. def determine_template(options) #:nodoc: - keys = options[:locals].try(:keys) || [] + keys = options[:locals].try(:keys) || [] + details = options.slice(:formats, :locale, :handlers) if options.key?(:text) Template::Text.new(options[:text], formats.try(:first)) elsif options.key?(:file) - with_fallbacks { find_template(options[:file], nil, false, keys) } + with_fallbacks { find_template(options[:file], nil, false, keys, details) } elsif options.key?(:inline) handler = Template.handler_for_extension(options[:type] || "erb") Template.new(options[:inline], "inline template", handler, :locals => keys) |