Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange :id in :path — /4f8b/5a82/ef1a/7750/b800/0077/ #26

Closed
newstler opened this issue Jun 5, 2012 · 1 comment
Closed

Strange :id in :path — /4f8b/5a82/ef1a/7750/b800/0077/ #26

newstler opened this issue Jun 5, 2012 · 1 comment

Comments

@newstler
Copy link

newstler commented Jun 5, 2012

Hi,

I've just upgraded from Rails 3.1.3 to 3.2.3 and noticed that browser doesn't show images anymore. So I looked to images path and it is /system/photos/images/4fce/1fb6/3ee5/1d01/a800/0006/original/IMG_2842new2.jpg?1338908598 for example. There is no :path declaration in model, so it should use default :rails_root/public/system/:attachment/:id/:style/:filename.

The key thing the images aren't shown is that :id parameter 4fce1fb63ee51d01a8000006 is stored in DB devided by slashes (/) into 4-symbol groups: 4fce/1fb6/3ee5/1d01/a800/0006, but the folder is named as it sould be, 4fce1fb63ee51d01a8000006. That's pretty strange.

I use

mongo (1.6.2) 
mongoid (2.4.10) 
paperclip (3.0.4) 
mongoid-paperclip (0.0.7) 
@newstler
Copy link
Author

It was my mistake, didn't notice that when I did updates Paperclip updated too and that version 3.0 requires :path and :url options to be passed explicitly:

:path => ":rails_root/public/system/:attachment/:id/:style/:filename",
:url => "/system/:attachment/:id/:style/:filename"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant