From eb19ca3457c7b9908c71376f9b3b4431fcd24c6f Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Wed, 11 Jul 2012 12:18:52 +0400 Subject: Common behavior with adding formats to lookup_context for TemplateRenderer and PartialRenderer --- actionpack/lib/action_view/lookup_context.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view/lookup_context.rb') diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb index 00989ec405..47dd932c71 100644 --- a/actionpack/lib/action_view/lookup_context.rb +++ b/actionpack/lib/action_view/lookup_context.rb @@ -96,7 +96,7 @@ module ActionView # Helpers related to template lookup using the lookup context information. module ViewPaths - attr_reader :view_paths + attr_reader :view_paths, :html_fallback_for_js # Whenever setting view paths, makes a copy so we can manipulate then in # instance objects as we wish. @@ -184,7 +184,10 @@ module ActionView def formats=(values) if values values.concat(default_formats) if values.delete "*/*" - values << :html if values == [:js] + if values == [:js] + values << :html + @html_fallback_for_js = true + end end super(values) end -- cgit v1.2.3