diff options
author | José Valim <jose.valim@gmail.com> | 2010-10-10 12:34:31 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-10-10 12:43:26 +0200 |
commit | 940b57789fb9166658974c591e68d22ecab29f34 (patch) | |
tree | ffaf3b57cc89663f5e48a7fc5567dcb510fa931e /actionpack/lib/action_view/renderer/partial_renderer.rb | |
parent | b88f4ca93bcaef9a6bfd21d95acc8f432a3c8e5c (diff) | |
download | rails-940b57789fb9166658974c591e68d22ecab29f34.tar.gz rails-940b57789fb9166658974c591e68d22ecab29f34.tar.bz2 rails-940b57789fb9166658974c591e68d22ecab29f34.zip |
Add support to render :once.
This will be used internally by sprockets to ensure requires are executed just once.
Diffstat (limited to 'actionpack/lib/action_view/renderer/partial_renderer.rb')
-rw-r--r-- | actionpack/lib/action_view/renderer/partial_renderer.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb index 3be1702f9e..eff425687b 100644 --- a/actionpack/lib/action_view/renderer/partial_renderer.rb +++ b/actionpack/lib/action_view/renderer/partial_renderer.rb @@ -2,7 +2,6 @@ require 'action_view/renderer/abstract_renderer' module ActionView class PartialRenderer < AbstractRenderer #:nodoc: - N = ::ActiveSupport::Notifications PARTIAL_NAMES = Hash.new {|h,k| h[k] = {} } def initialize(view) @@ -46,11 +45,11 @@ module ActionView identifier = ((@template = find_partial) ? @template.identifier : @path) if @collection - N.instrument("render_collection.action_view", :identifier => identifier || "collection", :count => @collection.size) do + instrument(:collection, :identifier => identifier || "collection", :count => @collection.size) do render_collection end else - N.instrument("render_partial.action_view", :identifier => identifier) do + instrument(:partial, :identifier => identifier) do render_partial end end @@ -83,7 +82,7 @@ module ActionView view._layout_for(*name, &block) end - content = render_layout(layout, locals){ content } if layout + content = layout.render(view, locals){ content } if layout content end |