title: How to add link to Magnific Popup's javascript
body: <p>I have the magnific popup on my app and I need help with adding a action to the lightbox. I have added my code to the javascript and outside of it but it never appears inside the lightbox.</p>
  
  <p>I need to add several pieces to the lighbox such as a link that will allow user to make ProfileImage, messages compose box, and short bio of the user. If I can learn how to do one then I am confident I can do the rest.</p>
  
  <p>The action is <code>&lt;%= button_to('Set as Profile Image', [:avatar, @photo]) %&gt;</code></p>
  
  <p>show.html.erb:</p>
  
  <pre><code>&lt;h1&gt;&lt;%= @user.username %&gt;&lt;/h1&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('.parent-container').magnificPopup({
              delegate: 'a',
              type: 'image',
  gallery:{enabled:true}
          });   
      });
  
  
  &lt;/script&gt;
  
  
  &lt;div class="parent-container"&gt;
      &lt;% @user.photos.each do |photo| %&gt;
          &lt;%= link_to image_tag(photo.image_url(:thumb)), photo.image_url%&gt;
  &lt;% end %&gt;&lt;/div&gt;&lt;/p&gt;
  </code></pre>