Paperclip downloads 404

I'm not sure how much I understand how Paperclip works, but as far as I can tell, the default location for saving downloads is in the / public folder. When I upload my photo to my development, they are displayed correctly (and I can open them in the file structure):

/public/bookmarks/:id/:style.:extension

However, when I do bookmark.photo.url, I get something like:

/system/bookmarks/thumbs/000/000/042/original/filename.png?1362768439

Here's mine bookmark.rb:

has_attached_file   :photo,
                        :styles => { :medium => ["512x512>", :jpg], :thumb => ["200x200#", :jpg] }
                        :default_url => "public/bookmarks/default/:style.png",
                        :path => "assets/content/bookmarks/:id/:style.:extension"

Am I missing something? Wasn’t Paperclip meant for me, or is there something wrong with the config?

UPDATE

If I add :path, and :urlthe first response I get:

<img src="/assets/bookmarks/44/original.jpg?1362775508">

While I should receive:

<img src="/bookmarks/44/original.jpg?1362775508">

But if I comment on the option :url, instead of getting:

This, which is the default size

which is the default default image size, I get:

enter image description here

, , , . Chrome, Safari . URL-, 404. , .

+5
2

, , . : url : , :

url: '/:class/:id/:style.:extension',
path: ':rails_root/public:url'

, :

"#{Rails.root}/public/bookmarks/:id/:style.:extension"

URL- - :

/bookmarks/bookmarks/1/thumbs.png

, config.paperclip_defaults "application.rb", . "production.rb", , :

  config.paperclip_defaults = config.paperclip_defaults.merge({
    storage: :s3,
    path: 'project_name/public:url'
  })
+1

. 404, :styles :style /app/models/mymodel.rb

class Pin < ActiveRecord::Base
    belongs_to :user
    has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }
    validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
end
0

All Articles