hobo with paperclip

13 views
Skip to first unread message

JezC

unread,
Jan 3, 2012, 6:11:48 AM1/3/12
to Hobo Users
I've been using (with success) the Hobo cookbook for attaching files
to Hobo models - http://cookbook.hobocentral.net/plugins/paperclip_with_hobo

I'd like to make the uploaded file required.

I can't say:

has_attached_file :thing, :required

Well, I _can_, but only if I want an error message... This means that
I have to use "validate_presence_of " for each element of a file
upload (filename, size, etc), instead, I think?

Bob Sleys

unread,
Jan 3, 2012, 9:14:43 AM1/3/12
to hobo...@googlegroups.com
Use the validate_presece_of check on the same symble you used is the has_attached_file IE following the with the recipe you posted it would be validate_presence_of :photo

Bob

JezC

unread,
Jan 3, 2012, 10:15:24 AM1/3/12
to Hobo Users
Brilliant. A shortcut to success. Thanks!
Reply all
Reply to author
Forward
0 new messages