Module: FlashAnalytics::ActionViewExtensions
- Defined in:
- lib/flash_analytics/action_view_extensions.rb
Instance Method Summary collapse
-
#render_analytics ⇒ Object
concatenates all analytics partials and renders them as html or text (depending on environment).
Instance Method Details
#render_analytics ⇒ Object
concatenates all analytics partials and renders them as html or text (depending on environment)
8 9 10 11 12 13 14 15 |
# File 'lib/flash_analytics/action_view_extensions.rb', line 8 def render_analytics return unless flash.has_analytics? content = analytics_partial_content # only render as html for selected environments, else render as text within display:none div FlashAnalytics.active_environments.include?(Rails.env) ? raw(content) : raw('<div style="display:none">')+content+raw('</div>') end |