lundi 21 novembre 2016

broken image tags - In RAILS

Problem Description This application is using custom image js library (flex-slider). It's using data-thumb attributes.

<li data-thumb="images/show.jpg">
        <div class="thumb-image">
             <%= image_tag "show.jpg", data_imagezoom: "true", class: "img responsive"%>
       </div>
  </li>

In rails, it fails to pickup images on tags. I get an error on console.

show.jpg:1 GET http://localhost:3000/products/images/show.jpg 404 (Not Found)

How can I get rails to pick up these images ?

Expected Behavior enter image description here

Actual Behavior

enter image description here

Trouble Shooting Done

I've tried replacing

<li data-thumb=<%= image_tag "show.jpg"> 

OR <li data-thumb=<%=image_path("show1.jpg") %>>

AND <li data-thumb = asset_path("logo.png", image)>

Please let me know in case you need more info

Thanks

Aucun commentaire:

Enregistrer un commentaire