I’m struggling with a single avatar upload system for a user. I’ve hit
brick walls with two different routes, so I’d appreciate pointers on
choosing the right solution and fixing it:
First attempt: attachment_fu (via this tutorial:
http://railsforum.com/viewtopic.php?id=15389 ). However, I can’t get
attachment_fu to crop the images, even with the suggestion outlined in
this post ;
If I include a ! next to the dimensions (as suggested), RMagick seems to
ignore the dimensions and save all the thumbnails as the ‘resize’ size.
Could it be my version of RMagick? Has attachment_fu been updated to
crop images? I have to get cropping working, so this is a show stopper!
Second attempt: file_column. The guys from Less Everything have a
solution in their LovdByLess app which would work really well. They used
the file_column plugin to store an ‘icon’ in the users table, and so
users can only have one icon, which is exactly what I need in my app
(and they have cropping working, too!). However, I’ve tried route, and
file_upload is hitting a “No such file or directory” error during the
upload process. It’s saving and cropping images to /user/avatar/tmp on
the file system - so at least I know the cropping is working this time -
but my UsersController is hitting this; “Errno::ENOENT in
UsersController#update”, “No such file or directory” during the upload
Attachment_fu seems to be the preferred choice, but the file_column
route would, presumably, require less work to enforce the one avatar
only restriction. Any suggestions?