aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorKassio Borges <kassioborgesm@gmail.com>2013-08-23 22:46:49 -0300
committerKassio Borges <kassioborgesm@gmail.com>2013-08-24 15:24:36 -0300
commit424a5a7d46176eaa9617ad4fdc99d8c2be53b186 (patch)
treeb5fba23f5475f48692b6298863217669c0f0a624 /actionpack/lib/action_view
parentadf6e30e3ad448c1edf2878255922a3faaa77c99 (diff)
downloadrails-424a5a7d46176eaa9617ad4fdc99d8c2be53b186.tar.gz
rails-424a5a7d46176eaa9617ad4fdc99d8c2be53b186.tar.bz2
rails-424a5a7d46176eaa9617ad4fdc99d8c2be53b186.zip
fix issue #11605
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/lookup_context.rb7
-rw-r--r--actionpack/lib/action_view/renderer/abstract_renderer.rb6
-rw-r--r--actionpack/lib/action_view/renderer/partial_renderer.rb2
-rw-r--r--actionpack/lib/action_view/renderer/template_renderer.rb5
4 files changed, 4 insertions, 16 deletions
diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb
index 1a656ed37f..9f617a9a53 100644
--- a/actionpack/lib/action_view/lookup_context.rb
+++ b/actionpack/lib/action_view/lookup_context.rb
@@ -103,7 +103,7 @@ module ActionView
# Helpers related to template lookup using the lookup context information.
module ViewPaths
- attr_reader :view_paths, :html_fallback_for_js
+ attr_reader :view_paths
# Whenever setting view paths, makes a copy so we can manipulate then in
# instance objects as we wish.
@@ -200,10 +200,7 @@ module ActionView
def formats=(values)
if values
values.concat(default_formats) if values.delete "*/*"
- if values == [:js]
- values << :html
- @html_fallback_for_js = true
- end
+ values << :html if values == [:js]
end
super(values)
end
diff --git a/actionpack/lib/action_view/renderer/abstract_renderer.rb b/actionpack/lib/action_view/renderer/abstract_renderer.rb
index b79b89e142..0b5d3785d4 100644
--- a/actionpack/lib/action_view/renderer/abstract_renderer.rb
+++ b/actionpack/lib/action_view/renderer/abstract_renderer.rb
@@ -37,11 +37,5 @@ module ActionView
def instrument(name, options={})
ActiveSupport::Notifications.instrument("render_#{name}.action_view", options){ yield }
end
-
- def prepend_formats(formats)
- formats = Array(formats)
- return if formats.empty? || @lookup_context.html_fallback_for_js
- @lookup_context.formats = formats | @lookup_context.formats
- end
end
end
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb
index f3300e470b..71fa05ab3e 100644
--- a/actionpack/lib/action_view/renderer/partial_renderer.rb
+++ b/actionpack/lib/action_view/renderer/partial_renderer.rb
@@ -281,8 +281,6 @@ module ActionView
@block = block
@details = extract_details(options)
- prepend_formats(options[:formats])
-
if String === partial
@object = options[:object]
@path = partial
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb
index d15e75637a..a27d5dd1b1 100644
--- a/actionpack/lib/action_view/renderer/template_renderer.rb
+++ b/actionpack/lib/action_view/renderer/template_renderer.rb
@@ -10,10 +10,9 @@ module ActionView
template = determine_template(options)
context = @lookup_context
- prepend_formats(template.formats)
-
unless context.rendered_format
- context.rendered_format = template.formats.first || formats.last
+ context.formats = template.formats unless template.formats.empty?
+ context.rendered_format = context.formats.first
end
render_template(template, options[:layout], options[:locals])