Reputation: 153
I'm currently taking an online course on Rails and I'm using the Carrierwave gem to have a photo uploading function on a test restaurant review site. When I type the following code:
<%= @review.photo %>
The output is:
/uploads/review/photo/12/aqua-roma-aqua-tokyo.jpg
However, when I add the image_tag
<%= image_tag @review.photo %>
The output gives me the following error:
Can't resolve image into URL: undefined method `to_model' for #PhotoUploader:0x00007fc684572ec8 Did you mean? to_xml
Upvotes: 0
Views: 111
Reputation: 2895
With carrierwave, displaying image should be like
= image_tag( @review.photo.url)
Upvotes: 1