def pagehook(name, data = {})
      data_json = PagehookRails::PagehookHelper.escape_json(data.to_json)
      content_tag(:script, data_json, type: "application/json", "data-pagehook" => name)
    end
def pagehook(name, data = {})
      data_json = PagehookRails::PagehookHelper.escape_json(data.to_json)
      content_tag(:script, data_json, type: "application/json", "data-pagehook" => name)
    end
<%= pagehook("articles/show", id: 123) %>
 makes
 <script type="application/json" data-pagehook-name="articles/show">{"id": 123}</script>