diff options
author | Dmitry Vorotilin <d.vorotilin@gmail.com> | 2012-07-11 12:18:52 +0400 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2013-04-02 10:36:23 -0700 |
commit | 2c22376fe04b89e8f34620139720b85a85ce3428 (patch) | |
tree | bda9c828cf2f7519a48e655b00b813543592d1ed /actionpack/lib/action_view/renderer/abstract_renderer.rb | |
parent | 060fca78970e54b6400296325a212632de727b21 (diff) | |
download | rails-2c22376fe04b89e8f34620139720b85a85ce3428.tar.gz rails-2c22376fe04b89e8f34620139720b85a85ce3428.tar.bz2 rails-2c22376fe04b89e8f34620139720b85a85ce3428.zip |
Common behavior with adding formats to lookup_context for TemplateRenderer and PartialRenderer
Diffstat (limited to 'actionpack/lib/action_view/renderer/abstract_renderer.rb')
-rw-r--r-- | actionpack/lib/action_view/renderer/abstract_renderer.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/renderer/abstract_renderer.rb b/actionpack/lib/action_view/renderer/abstract_renderer.rb index 0b5d3785d4..b79b89e142 100644 --- a/actionpack/lib/action_view/renderer/abstract_renderer.rb +++ b/actionpack/lib/action_view/renderer/abstract_renderer.rb @@ -37,5 +37,11 @@ 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 |