Module: PublicActivity::ViewHelpers

Defined in:
lib/public_activity/utility/view_helpers.rb

Overview

Module extending ActionView::Base and adding `render_activity` helper.

Instance Method Summary (collapse)

Instance Method Details

- (Object) render_activity(activity, options = {})

View helper for rendering an activity, calls Activity#render internally.



6
7
8
# File 'lib/public_activity/utility/view_helpers.rb', line 6

def render_activity activity, options = {}
  activity.render self, options
end

- (Object) single_content_for(name, content = nil, &block)

Helper for setting content_for in activity partial, needed to flush remains in between partial renders.



11
12
13
14
# File 'lib/public_activity/utility/view_helpers.rb', line 11

def single_content_for(name, content = nil, &block)
  @view_flow.set(name, ActiveSupport::SafeBuffer.new)
  content_for(name, content, &block)
end