On Saturday 07 August 2010, Marco Scholl wrote:
> Hi
>
> ich muss eben einen validator auf ein vor- und nachname feld das
> keine zahl im text enthalten sein darf. ich bekomm das regex im
> validates_format_of nicht negativ.jemand eine idee?
Rails 3 kann
validates_format_of :email, :without => /NOSPAM/
validates :email, :format => { :without => /NOSPAM/ }
In Rails 2.3.x würde ich es manuell machen:
def validate
errors.add('email', 'Spam Spam Spam') if email =~ /SPAM/
end
Michael
--
Michael Schuerig
mailto:[email protected]
http://www.schuerig.de/michael/
_______________________________________________
rubyonrails-ug mailing list
[email protected]
http://mailman.headflash.com/listinfo/rubyonrails-ug