Module: DuckMap::ActionViewHelpers
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActionViewTestObject
- Defined in:
- lib/duck_map/view_helpers.rb
Overview
Support for seo related meta tags in page headers.
Instance Method Summary collapse
-
#sitemap_meta_canonical ⇒ String
Generates a canonical link tag for use inside HTML header area.
- #sitemap_meta_canonical=(value) ⇒ Object
-
#sitemap_meta_description ⇒ String
Generates a description meta tag for use inside HTML header area.
- #sitemap_meta_description=(value) ⇒ Object
-
#sitemap_meta_keywords ⇒ String
Generates a keywords meta tag for use inside HTML header area.
- #sitemap_meta_keywords=(value) ⇒ Object
-
#sitemap_meta_lastmod ⇒ String
Generates a Last-Modified meta tag for use inside HTML header area.
- #sitemap_meta_lastmod=(value) ⇒ Object
-
#sitemap_meta_tag ⇒ String
Generates a meta tags title, keywords, description and Last-Modified for use inside HTML header area.
-
#sitemap_meta_title ⇒ String
Generates a title tag for use inside HTML header area.
- #sitemap_meta_title=(value) ⇒ Object
Instance Method Details
#sitemap_meta_canonical ⇒ String
Generates a canonical link tag for use inside HTML header area.
87 88 89 |
# File 'lib/duck_map/view_helpers.rb', line 87 def return controller.[:canonical].blank? ? nil : tag(:link, {rel: :canonical, href: controller.[:canonical]}, false, false) end |
#sitemap_meta_canonical=(value) ⇒ Object
91 92 93 |
# File 'lib/duck_map/view_helpers.rb', line 91 def (value) controller.[:canonical] = value end |
#sitemap_meta_description ⇒ String
Generates a description meta tag for use inside HTML header area.
65 66 67 |
# File 'lib/duck_map/view_helpers.rb', line 65 def return controller.[:description].blank? ? nil : tag(:meta, {name: :description, content: controller.[:description]}, false, false) end |
#sitemap_meta_description=(value) ⇒ Object
69 70 71 |
# File 'lib/duck_map/view_helpers.rb', line 69 def (value) controller.[:description] = value end |
#sitemap_meta_keywords ⇒ String
Generates a keywords meta tag for use inside HTML header area.
54 55 56 |
# File 'lib/duck_map/view_helpers.rb', line 54 def return controller.[:keywords].blank? ? nil : tag(:meta, {name: :keywords, content: controller.[:keywords]}, false, false) end |
#sitemap_meta_keywords=(value) ⇒ Object
58 59 60 |
# File 'lib/duck_map/view_helpers.rb', line 58 def (value) controller.[:keywords] = value end |
#sitemap_meta_lastmod ⇒ String
Generates a Last-Modified meta tag for use inside HTML header area.
76 77 78 |
# File 'lib/duck_map/view_helpers.rb', line 76 def return controller.[:lastmod].blank? ? nil : tag(:meta, {name: "Last-Modified", content: controller.[:lastmod]}, false, false) end |
#sitemap_meta_lastmod=(value) ⇒ Object
80 81 82 |
# File 'lib/duck_map/view_helpers.rb', line 80 def (value) controller.[:lastmod] = value end |
#sitemap_meta_tag ⇒ String
Generates a meta tags title, keywords, description and Last-Modified for use inside HTML header area.
98 99 100 101 |
# File 'lib/duck_map/view_helpers.rb', line 98 def buffer = "#{self.}\r\n #{self.}\r\n #{self.}\r\n #{self.}\r\n #{self.}\r\n".html_safe return buffer.html_safe end |
#sitemap_meta_title ⇒ String
Generates a title tag for use inside HTML header area.
43 44 45 |
# File 'lib/duck_map/view_helpers.rb', line 43 def return controller.[:title].blank? ? nil : content_tag(:title, controller.[:title], false) end |
#sitemap_meta_title=(value) ⇒ Object
47 48 49 |
# File 'lib/duck_map/view_helpers.rb', line 47 def (value) controller.[:title] = value end |