From f4780217e1ef521d2997ea35b6d59d9f3a67ee31 Mon Sep 17 00:00:00 2001 From: Nicolae Claudius Date: Mon, 2 Jul 2012 20:58:35 +0300 Subject: [PATCH] validate contact for email format --- app/mailers/contact_form.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/mailers/contact_form.rb b/app/mailers/contact_form.rb index 9b83a41..8a6ea5b 100644 --- a/app/mailers/contact_form.rb +++ b/app/mailers/contact_form.rb @@ -5,6 +5,8 @@ class ContactForm < MailForm::Base attribute :file, :attachment => true, :allow_blank => true attribute :nickname, :captcha => true # antispam + validates :email, email: true + # Declare the e-mail headers. It accepts anything the mail method # in ActionMailer accepts. def headers