Module: Metas::Helpers::Tags::InstanceMethods
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/metas/helpers/tags.rb
Instance Method Summary collapse
Instance Method Details
#get_meta(attr) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/metas/helpers/tags.rb', line 19 def (attr) split_attr = attr.split(":") = .normalize.deep_stringify_keys return nil if [split_attr[0]].nil? [split_attr[0]][split_attr[1]] end |
#meta_tags ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/metas/helpers/tags.rb', line 9 def .normalize.each_with_object([]) do |(tag, values), ary| correct_property = .[:irregular][tag] || .[:irregular][:default] values.each do |attr, content| ary << tag(:meta, { :content => content, correct_property => (tag, attr) }, true, false) end end.join("\n").html_safe end |