<!-- insert_after 'meta'-->
<% content_for :head dp %>
  <script type='text/javascript'>
    $(document).ready(function () {
      $('#main-image').magnificPopup({
        delegate: 'a',
        type: 'image'
      });
    });
  </script>
<% end %>

<!-- insert_after 'meta'-->
<script type='text/javascript'>
  $(document).ready(function () {
    $('#main-image').magnificPopup({
      delegate: 'a',
      type: 'image'
    });
  });
</script>

Add magnific popup script to head.
Add magnific popup script to head.
