Module: RecommendationsHelper

Defined in:
lib/generators/refinery/templates/helpers/recommendations_helper.rb

Instance Method Summary collapse

Instance Method Details

#citation_line(t) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/generators/refinery/templates/helpers/recommendations_helper.rb', line 3

def citation_line(t)
  [
    (:b, h(t.name)),
    h(t.role),
    website_or_company(t)
  ].reject{|o| o.blank?}.join(', ').sub(/,\s/, ': ')
end

#website_or_company(t) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/generators/refinery/templates/helpers/recommendations_helper.rb', line 11

def website_or_company(t)
  if t.company_url.blank?
    h(t.company)
  else
    (:a, h(t.company.blank? ? t.company_url : t.company), :href => h(t.company_url))
  end
end