module StructuredData::ActionView::Helpers

Public Instance Methods

structured_data_tag(hash) click to toggle source
# File lib/structured_data/action_view/helpers.rb, line 4
def structured_data_tag hash
  content_tag(:script, hash.to_json, {type: 'application/ld+json'}, false) # false is used here to prevent html character escaping
end