validates_format_of :email,
:with=>/^[0-9a-za-z_][\w\.-]*[a-za-z0-...@[a-za-z0-9][\w\.-]*[a-za-
Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/,
:message => "is not valid",
:unless => Proc.new { |your_model_name_or_any_variable_name_you_want|
your_model_name_or_any_variable_name_you_want
Hi,
Use allow_blank => true
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email t
:allow_nil => true
On Apr 16, 4:42 pm, Tushar Gandhi wrote:
> Hi,
> I am trying to validate the email format by using "validates_format_of".
> I have written a code like this:-
> "validates_format_of :email,
> :with=>/^[0-9a-za-z_][\w\.-]*[a-za-z0-...@[a-za-z0-9][\w\.-]*[a-za-z0-9]\.[a-za-z][a-za
Tushar Gandhi wrote:
> Hi,
> I am trying to validate the email format by using "validates_format_of".
> I have written a code like this:-
> "validates_format_of :email,
> :with=>/^[0-9a-za-z_][\w\.-]*[a-za-z0-...@[a-za-z0-9][\w\.-]*[a-za-z0-9]\.[a-za-z][a-za-z\.]*[a-za-z]$/,
>
4 matches
Mail list logo