home > code > How To Permit A Blank Email Field With AuthLogic

How To Permit A Blank Email Field With AuthLogic

September 9th, 2009 Leave a comment Go to comments

errors from blank email with AuthLogic

I too ran into some trouble before discovering that my beloved AuthLogic is validating my email field. The validation is a good thing overall, but I want to support blank email addresses as well as properly formatted ones.

It’s all in the AuthLogic docs of course, but if I can save you a few minutes of hunting around, that’s all good:


acts_as_authentic do |c|
  c.merge_validates_length_of_email_field_options({:allow_nil => true})
  c.merge_validates_format_of_email_field_options({:allow_nil => true})
end

  1. No comments yet.
  1. No trackbacks yet.