Module: Metaslug::ActionViewExtension
- Defined in:
- lib/metaslug/helpers/action_view_extension.rb
Instance Method Summary collapse
Instance Method Details
#metaslug ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/metaslug/helpers/action_view_extension.rb', line 3 def @metaslug.inject([]) do |acc, (k, v)| if 'title' == k.to_s acc << content_tag(:title, @metaslug['title']) elsif v.is_a?(Hash) # more complicated metas, like property (v, k, acc) else acc << tag(:meta, { name: k.to_s, content: @metaslug[k.to_s] }, true ) end acc end.join.html_safe end |