Module: Rubaidh::GoogleAnalyticsViewHelper

Defined in:
lib/rubaidh/view_helpers.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

Raises:



3
4
5
6
7
# File 'lib/rubaidh/view_helpers.rb', line 3

def link_to_tracked(name, track_path = "/", options = {}, html_options = {})
  raise AnalyticsError.new("You must set Rubaidh::GoogleAnalytics.defer_load = false to use outbound link tracking") if GoogleAnalytics.defer_load == true
  html_options.merge!({:onclick => tracking_call(track_path)})
  link_to name, options, html_options
end

Raises:



9
10
11
12
13
# File 'lib/rubaidh/view_helpers.rb', line 9

def link_to_tracked_if(condition, name, track_path = "/", options = {}, html_options = {}, &block)
  raise AnalyticsError.new("You must set Rubaidh::GoogleAnalytics.defer_load = false to use outbound link tracking") if GoogleAnalytics.defer_load == true
  html_options.merge!({:onclick => tracking_call(track_path)})
  link_to_unless !condition, name, options, html_options, &block
end

Raises:



15
16
17
18
19
# File 'lib/rubaidh/view_helpers.rb', line 15

def link_to_tracked_unless(condition, name, track_path = "/", options = {}, html_options = {}, &block)
  raise AnalyticsError.new("You must set Rubaidh::GoogleAnalytics.defer_load = false to use outbound link tracking") if GoogleAnalytics.defer_load == true
  html_options.merge!({:onclick => tracking_call(track_path)})
  link_to_unless condition, name, options, html_options, &block
end

Raises:



21
22
23
24
25
# File 'lib/rubaidh/view_helpers.rb', line 21

def link_to_tracked_unless_current(name, track_path = "/", options = {}, html_options = {}, &block)
  raise AnalyticsError.new("You must set Rubaidh::GoogleAnalytics.defer_load = false to use outbound link tracking") if GoogleAnalytics.defer_load == true
  html_options.merge!({:onclick =>tracking_call(track_path)})
  link_to_unless current_page?(options), name, options, html_options, &block
end