Search code examples
ruby-on-rails-4filepicker

rails with filepicker and make image itself clickable


I'am using rails 4 with filepicker but I can't get the links to images autoclickables.

<% @pins.each do |pin| %>

    <!--<%#= image_tag pin.image.url(:medium) %>  -->
    <%= link_to filepicker_image_tag pin.filepicker_url, w: 200, h: 200, fit: 'clip' %><br/>
    <%= pin.description %><br/ >

With link_to image link's points to the view itself, not the image itself.

I'm sorry but I don't see it, some clue?

Thanks in advance and sorry for my english.


Solution

  • Try this it will work , you were missing url to define

    <%= link_to (filepicker_image_tag pin.filepicker_url, w: 200, h: 200, fit: 'clip') , pin.filepicker_url %><br/>