On June 29, 2011 07:45:27 PM hobo_hippy wrote:
> So it's pretty clear you can require a field like title below:
> 
> 
> fields do
>     timestamps
>     title :string, :required
>     event :string
>   end
> 
> but what if I wanted to require an attachment using paperclip-with-
> hobo?
> 
> I already have an photo attachment setup as below:
> 
> has_attached_file :photo, :default_url => "/images/blah.jpg"
> 
> 
> but I have no idea how to REQUIRE that a user uploads an image. Any
> ideas? possible solutions?

    validates_presence_of :photo

But, this does not guarantee that what is uploaded actually is an image.

Henry

-- 
Henry Baragar
Instantiated Software

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to