could I do somethink like this
validates _presence_of :img_path if => {:img_url.nil?}
the syntax of this is not quite right but
On 9/9/06, Dion Hewson
<dionhewson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> how would you validate one of two fields
>
> users can upload an image from either the file system or from a url
>
> in the model how do you validate that at least only one is being used
>
> i.e
>
> validates_presence_of :img_path or validates_presence_of :img_url
>
>
> cheers
>
> dion
>
> --
>
> www.blogsaic.com
> search, post, blog
>
--
www.blogsaic.com
search, post, blog
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---