Module: MetaRailsHelpers::TitleHelper

Defined in:
lib/meta/rails/helpers/title_helper.rb

Instance Method Summary collapse

Instance Method Details

#title(identifier: :title, separator: '|', brand: default_brand, reverse: false) ⇒ Object

Produces html title element



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/meta/rails/helpers/title_helper.rb', line 4

def title(identifier: :title,
          separator: '|',
          brand: default_brand,
          reverse: false)
  title = content_for(identifier)
  separator = '' unless title.present? && brand.present?
  if reverse == true
     :title, [brand, separator, title].reject(&:blank?).join(' ')
  else
     :title, [title, separator, brand].reject(&:blank?).join(' ')
  end
end