Module: Geri::MetaHelper
- Defined in:
- app/helpers/geri/meta_helper.rb
Instance Attribute Summary collapse
-
#page_title ⇒ Object
readonly
Returns the value of attribute page_title.
Instance Method Summary collapse
- #description(text) ⇒ Object
- #keywords(*keywords) ⇒ Object
- #meta(options = nil) ⇒ Object
- #meta_tags ⇒ Object
- #title(text) ⇒ Object
Instance Attribute Details
#page_title ⇒ Object (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) description: text end |
#keywords(*keywords) ⇒ Object
13 14 15 |
# File 'app/helpers/geri/meta_helper.rb', line 13 def keywords(*keywords) keywords: keywords end |
#meta(options = nil) ⇒ Object
17 18 19 20 21 |
# File 'app/helpers/geri/meta_helper.rb', line 17 def (=nil) ||= {} .reverse_merge!() if end |
#meta_tags ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/helpers/geri/meta_helper.rb', line 23 def html = ''.html_safe .each do |name, content| html << content_tag(: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 |