Module: Bookends::ApplicationHelper

Defined in:
app/helpers/bookends/application_helper.rb

Defined Under Namespace

Classes: GlostickUserExtractor

Instance Method Summary collapse

Instance Method Details

#glostick_user_emailObject



27
28
29
# File 'app/helpers/bookends/application_helper.rb', line 27

def glostick_user_email
  glostick_user['email']
end

#glostick_user_nameObject



23
24
25
# File 'app/helpers/bookends/application_helper.rb', line 23

def glostick_user_name
  glostick_user['full_name']
end

#google_search_formObject



11
12
13
# File 'app/helpers/bookends/application_helper.rb', line 11

def google_search_form
  "<gcse:searchbox-only resultsUrl='/search'></gcse:searchbox-only>".html_safe
end

#google_search_resultsObject



15
16
17
# File 'app/helpers/bookends/application_helper.rb', line 15

def google_search_results
  "<gcse:searchresults-only linkTarget='_parent'></gcse:searchresults-only>".html_safe
end

#hero_classObject



46
47
48
# File 'app/helpers/bookends/application_helper.rb', line 46

def hero_class
  #to be overriden by consumers, optionally
end

#logged_in?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/helpers/bookends/application_helper.rb', line 19

def logged_in?
  !!cookies[:heroku_session]
end

#relative_search_pathObject



3
4
5
# File 'app/helpers/bookends/application_helper.rb', line 3

def relative_search_path
  '/search'
end

#search_disabled?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/helpers/bookends/application_helper.rb', line 7

def search_disabled?
  false
end


31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/helpers/bookends/application_helper.rb', line 31

def (title, options = {})
  url = "https://signup.heroku.com"
  data = { trackable: { category: "Sign Up Links", action: "Clicked", label: "#{options[:referral] || options[:branded_signup]}" } }

  url += "/#{options[:branded_signup]}" if options[:branded_signup]

  if options[:campaign_id]
    url = url + "?c=" + options[:campaign_id]
  elsif options[:referral]
    url = url + "/" + options[:referral]
  end

  link_to title, url, class: options[:class], data: data
end