Reputation: 1312
I have images that I am trying to include in my application that for some reason I cannot get to render. Usually when I include images in a project I link to them from Unsplash or another image hosting site.
For this project I wanted to use my own images and include the files within my directory rather than uploading them to imgur and linking to them.
This is what I tried...
I placed the images in the rails images directory and then created a thumbs directory within the images directory and included the same pictures.
I then tried linking to them in my gallery.html.erb file like so.
<a href="#">
<img src="assets/images/thumbs/one.jpg" alt="assets/images/one.jpg"/>
</a>
<a href="#">
<img src="app/assets/images/thumbs/2.jpg" alt="app/assets/images/2.jpg"/>
</a>
The file path seems to be right to me unless I am missing something, but in my browser they are not appearing. I appreciate any help you can provide
Upvotes: 0
Views: 92
Reputation: 394
use
<%= image_tag("/thumbs/one.jpg", size: "100x100", alt: "text") %>
Upvotes: 1
Reputation: 175
maybe your html file and theL asset/..
&& apps/..
is not in the same folder.
Upvotes: 0