delonnewman/dragnet

View on GitHub
app/views/replies/edit.html.erb

Summary

Maintainability
Test Coverage
<html>
  <body>
    <main
      id="survey-submitter"
      data-is-preview="<%= reply.new_record? %>"
      data-reply-id="<%= reply.id %>"
    ></main>
    <script>
     (function() {
       const script = document.createElement("script");
       const element = document.getElementById("survey-submitter");

       script.src = "<%= request.base_url %>/js/submitter/shell.js";
       script.onload = function() {
         dragnet.submitter.shell.init("survey-submitter");
       };
       document.head.append(script);
     }.call(window))
    </script>
  </body>
</html>