Module: PagesCore::OpenGraphTagsHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/pages_core/open_graph_tags_helper.rb
Instance Method Summary collapse
- #open_graph_properties ⇒ Object
-
#open_graph_tags ⇒ Object
Outputs Open Graph tags for Facebook.
Instance Method Details
#open_graph_properties ⇒ Object
5 6 7 |
# File 'app/helpers/pages_core/open_graph_tags_helper.rb', line 5 def open_graph_properties @open_graph_properties ||= {} end |
#open_graph_tags ⇒ Object
Outputs Open Graph tags for Facebook.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/pages_core/open_graph_tags_helper.rb', line 10 def properties = default_open_graph_properties.merge(open_graph_properties) safe_join( properties .delete_if { |_, content| content.nil? } .map do |name, content| tag.(property: "og:#{name}", content: content) end, "\n" ) end |