Sha256: 7d4fe9e11c349eb2b3592063ba73e04e80fba3243c8a90242b1bc97b8f1f1af8

Contents?: true

Size: 787 Bytes

Versions: 1

Compression:

Stored size: 787 Bytes

Contents

<% id = "#{Time.now.to_i}#{(rand * 1000).ceil}" %>

<div class="js-paloma-hook" data-id="<%= id %>">
  <script type="text/javascript">
    (function(){

      // Do not continue if Paloma not found.
      if (window['Paloma'] === undefined && window['console'] !== undefined){
        console.warn("Paloma not found. Require it in your application.js.");
        return true;
      }

      Paloma.env = '<%= Rails.env %>';

      // Remove any callback details if any
      $('.js-paloma-hook[data-id!=' + <%= id %> + ']').remove();

      var request = <%= request.to_json.html_safe %>;

      $(document).ready(function(){
        Paloma.engine.request(
          request['resource'],
          request['action'],
          request['params']);
      });

    })();
  </script>
</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paloma-4.0.0 app/views/paloma/_hook.html.erb