Module: Workarea::SchemaOrgHelper

Defined in:
app/helpers/workarea/schema_org_helper.rb

Instance Method Summary collapse

Instance Method Details

#email_action_schema(target, name, description = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/workarea/schema_org_helper.rb', line 7

def email_action_schema(target, name, description = nil)
  {
    '@context': 'http://schema.org',
    '@type': 'EmailMessage',
    'potentialAction': {
      '@type': 'ViewAction',
      'target': target,
      'url': target,
      'name': name
    },
    'description': description || name
  }
end

#render_schema_org(schema) ⇒ Object



3
4
5
# File 'app/helpers/workarea/schema_org_helper.rb', line 3

def render_schema_org(schema)
  tag.script(schema.to_json.html_safe, type: 'application/ld+json')
end