Module: Mokio::FrontendHelpers::SeoTagHelper

Defined in:
lib/mokio/frontend_helpers/seo_tag_helper.rb

Overview

Frontend helper methods used with Mokio::SeoTag objects

Instance Method Summary collapse

Instance Method Details

#render_seo_meta_tags(model_obj) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mokio/frontend_helpers/seo_tag_helper.rb', line 7

def render_seo_meta_tags(model_obj)
  result = ""
  return result unless model_obj.class.has_seo_tagable_enabled?
  collection = model_obj.seo_tags
  if collection.any?
    seo_hash =  {}
    Mokio::SeoTag.seo_tags_list.map{|a| seo_hash[a[:key].to_sym] = a[:type]}
    collection.each do |el|
      result << render_seo_meta_build_tag_helper(el,seo_hash)
    end
  end
  result
end