Module: SeoPages::ApplicationHelper
- Defined in:
- app/helpers/seo_pages/application_helper.rb
Instance Method Summary collapse
- #seo_data ⇒ Object
- #seo_meta_tag(type, content) ⇒ Object
- #seo_page ⇒ Object
- #seo_page_meta_description(content) ⇒ Object
- #seo_page_meta_keywrods(content) ⇒ Object
- #seo_page_title(content) ⇒ Object
- #seo_title_tag(content) ⇒ Object
Instance Method Details
#seo_data ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'app/helpers/seo_pages/application_helper.rb', line 3 def seo_data @seo_default ||= SeoPages::SeoPageDefault.first @seo = SeoPages::SeoPage.where(url_identifier: request.fullpath).first || SeoPages::SeoPage.new @seo.page_title ||= @seo_default.page_title @seo. ||= @seo_default. @seo. ||= @seo_default. @seo end |
#seo_meta_tag(type, content) ⇒ Object
19 20 21 |
# File 'app/helpers/seo_pages/application_helper.rb', line 19 def (type, content) "<meta name='#{type}' content='#{content}'>" end |
#seo_page ⇒ Object
23 24 25 26 27 28 |
# File 'app/helpers/seo_pages/application_helper.rb', line 23 def seo_page s_title = seo_title_tag(content_for?(:title) ? content_for(:title) : seo_data.page_title) s_desc = ('description', content_for?(:meta_description) ? content_for(:meta_description) : "#{seo_data.meta_description}") s_keywords = ('keywords', content_for?(:meta_keywords) ? content_for(:meta_keywords) : "#{seo_data.meta_keywords}") raw("#{s_title} \n #{s_desc} \n #{s_keywords}") end |
#seo_page_meta_description(content) ⇒ Object
34 35 36 |
# File 'app/helpers/seo_pages/application_helper.rb', line 34 def (content) content_for(:meta_description) { content } end |
#seo_page_meta_keywrods(content) ⇒ Object
38 39 40 |
# File 'app/helpers/seo_pages/application_helper.rb', line 38 def (content) content_for(:meta_keywords) { content } end |
#seo_page_title(content) ⇒ Object
30 31 32 |
# File 'app/helpers/seo_pages/application_helper.rb', line 30 def seo_page_title(content) content_for(:title) { content } end |
#seo_title_tag(content) ⇒ Object
14 15 16 |
# File 'app/helpers/seo_pages/application_helper.rb', line 14 def seo_title_tag(content) "<title>#{content}</title>" end |