Module: Geri::MetaHelper

Defined in:
app/helpers/geri/meta_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#page_titleObject (readonly)

Returns the value of attribute page_title.



3
4
5
# File 'app/helpers/geri/meta_helper.rb', line 3

def page_title
  @page_title
end

Instance Method Details

#description(text) ⇒ Object



9
10
11
# File 'app/helpers/geri/meta_helper.rb', line 9

def description(text)
  meta description: text
end

#keywords(*keywords) ⇒ Object



13
14
15
# File 'app/helpers/geri/meta_helper.rb', line 13

def keywords(*keywords)
  meta keywords: keywords
end

#meta(options = nil) ⇒ Object



17
18
19
20
21
# File 'app/helpers/geri/meta_helper.rb', line 17

def meta(options=nil)
  @meta ||= {}
  @meta.reverse_merge!(options) if options
  @meta
end

#meta_tagsObject



23
24
25
26
27
28
29
# File 'app/helpers/geri/meta_helper.rb', line 23

def meta_tags
  html = ''.html_safe
  meta.each do |name, content|
    html << (:meta, '', name: name, content: (content.is_a?(Array) ? content.join(', ') : content))
  end
  html
end

#title(text) ⇒ Object



5
6
7
# File 'app/helpers/geri/meta_helper.rb', line 5

def title(text)
  @page_title = text
end