I am developing simple web application in ruby on rails 3, where users can upload images and uploaded all images has to be displayed. Successfully i uploaded images into folder(photos) which is located in public and stored their url path in database.I am getting problem in displaying images.
image.html.erb
<% @photo.each do |photo| %>
<table>
<tr>
<td><img src = "#{photo.url}" /></td>
</tr>
</table>
<%end%>
in photos controller
def image
@photo = Photo.all
end
when iam giving path(photos/pic1.jpg) the loop has been working but it displaying only one image, if iam using photo.url it has been not displaying any image.