问题
I am using paperclip and Imagemagick to add images to a website. I have a form on the site for users to upload images. When I upload an image, it doesn't give any errors. When I check the rails console, the image is saved with the right size and all that. When I check the project folder, the images get saved in there too. But when I try to display, I get the following screen on the site(Only one image has been added, only the one on the left is supposed to show up, the missing tags on the rest are because no images are added there):Screenshot of screen
This is my index.html page:
<h1 class="current-category"><%= params[:category]%></h1>
<% if @books.count == 0 %>
<h1>There are no books currently in this category</h1>
<%else%>
<% @books.each do |book| %>
<a href="/books/<%= book.id %>">
<%= image_tag book.book_img.url(:book_index) %>
</a>
<% end %>
<%end%>
And I get the following error message on the terminal window:Screenshot of terminal window
Please let me know why this is happening. Thank you.
来源:https://stackoverflow.com/questions/43824679/paperclip-combined-with-imagemagick-saves-images-but-doesnt-display-them-on-the