Module: Rubaidh::GoogleAnalyticsViewHelper

Defined in:
lib/rubaidh/view_helpers.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details



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

def link_to_tracked(name, track_path = "/", options = {}, html_options = {})
  
  html_options.merge!({:onclick => tracking_call(track_path)})
  link_to name, options, html_options
end


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

def link_to_tracked_if(condition, name, track_path = "/", options = {}, html_options = {}, &block)
  html_options.merge!({:onclick => tracking_call(track_path)})
  link_to_unless !condition, name, options, html_options, &block
end


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

def link_to_tracked_unless(condition, name, track_path = "/", options = {}, html_options = {}, &block)
  html_options.merge!({:onclick => tracking_call(track_path)})
  link_to_unless condition, name, options, html_options, &block
end


19
20
21
22
# File 'lib/rubaidh/view_helpers.rb', line 19

def link_to_tracked_unless_current(name, track_path = "/", options = {}, html_options = {}, &block)
  html_options.merge!({:onclick =>tracking_call(track_path)})
  link_to_unless current_page?(options), name, options, html_options, &block
end