<% content_for :script do %>
  <script>require(['source-viewer/app']);</script>
<% end %>

<div id="source-viewer"></div>

<script type="text/javascript">
  window.file = {
    uuid: '<%= @resource.uuid -%>',
    key: '<%= @resource.key -%>'
    <% if @line %>,line: <%= @line -%><% end %>
  };
</script>

