From df85ab41c1ff6992dd462a0e63dac9dcdcee0348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 24 Feb 2010 22:06:24 +0100 Subject: Renamed LocalizedCache to DetailsCache. --- actionpack/lib/abstract_controller/rendering.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/abstract_controller/rendering.rb') diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index f5c20e8013..14f51ae1bf 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -165,13 +165,17 @@ module AbstractController details = _normalize_details(options) - options[:_template] ||= with_template_cache(name) do + options[:_template] ||= with_template_cache(name, details) do find_template(name, details, options) end end + def _details_defaults + { :formats => formats, :locale => [I18n.locale] } + end + def _normalize_details(options) - details = { :formats => formats } + details = _details_defaults details[:formats] = Array(options[:format]) if options[:format] details[:locale] = Array(options[:locale]) if options[:locale] details @@ -185,7 +189,7 @@ module AbstractController view_paths.exists?(name, details, options[:_prefix], options[:_partial]) end - def with_template_cache(name) + def with_template_cache(name, details) yield end -- cgit v1.2.3