diff --git a/app/models/contact.rb b/app/models/contact.rb index 0e46082..5a442ce 100755 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -2,6 +2,7 @@ class Contact < ActiveRecord::Base validates :name, :presence => true validates :email, :presence => true, :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i + validates :tel, :presence => true, :numericality => true, :length => { :minimum => 10, :maximum => 15 } validates :message, :presence => true diff --git a/app/views/public/contacts/_form.html.haml b/app/views/public/contacts/_form.html.haml index 5d0e7a0..c452d12 100755 --- a/app/views/public/contacts/_form.html.haml +++ b/app/views/public/contacts/_form.html.haml @@ -4,11 +4,11 @@ .row .columns.span_8 - =f.input :name, :label => false , :placeholder =>"Votre nom" - =f.input :email, :label => false , :placeholder =>"Votre email" - =f.input :tel, :label => false , :placeholder =>"Votre numéro de téléphone" + =f.input :name, :label => false , :placeholder =>"Votre nom*" + =f.input :email, :label => false , :placeholder =>"Votre email*" + =f.input :tel, :label => false , :placeholder =>"Votre numéro de téléphone*" - =f.input :message, :label =>false , :placeholder => "Votre projet" + =f.input :message, :label =>false , :placeholder => "Votre projet*" .columns.span_4.button_container{:style => "text-align:center;position:relative;height:300px"} .inner