I have Product model which are items in the e-commerce store and is configured with paperclip to i can upload images for the product model.
When i add the image for the product, the image appears in /system/image/../.../.../thumbs and original but when i do
<% for product in @products %>
<%= link_to product.image.url(:original) %>
<% end %>
it appears broken links (/system/image/missing.png) when i browse the page. Similar to doing a group of thumbnails - i am trying to achieve to get all the product images out like a thumbnail. (eg. photo gallery)
Other code include model are below:
class Product < ActiveRecord::Base
attr_accessible :name, :price, :image
has_attached_file :image, :styles => { :medium => "238x238>",
:thumb => "100x100>" }
do_not_validate_attachment_file_type :image
end
Controller:
def index
@products = Product.all
end