I want to validate a field in my form that's not an attribute in the model. How do I do this?
on 2009-02-27 03:51
on 2009-02-27 06:53
define it as a getter and setter. On Fri, Feb 27, 2009 at 10:49 AM, Mike C <firstname.lastname@example.org> wrote: > > I want to validate a field in my form that's not an attribute in the > model. How do I do this? > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc
on 2009-02-27 07:11
Ok, I did it. But in the model I have validates_presence_of, and even though the field is filled, I keep getting the blank error.
on 2009-02-27 09:20
Nevermind, getter was returning a user object instead of a string. fixed. :)
on 2009-02-27 10:03
Hi Mike. Can you share the code snippet for the getter and setter methods you used, thanks.