Forum: Ruby on Rails Email validation in controller

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
25c4b7d5fc7f09900d8f272bcb31d114?d=identicon&s=25 Hamid Raza (hamidraza)
on 2009-04-16 15:39
hi all ,


i want to check/validate email in controller, with out using model . plz
some one help me out.











thx in advance
5772c599ccab3081e0fffb1d54f3b6de?d=identicon&s=25 Andrew Timberlake (andrewtimberlake)
on 2009-04-16 15:52
(Received via mailing list)
On Thu, Apr 16, 2009 at 3:39 PM, Hamid Raza
<rails-mailing-list@andreas-s.net> wrote:
>
> hi all ,
>
> i want to check/validate email in controller, with out using model . plz
> some one help me out.
>
> thx in advance

Just use a regular expression, it could be as simple as
if params[:email] =~ /@/
  ...valid...
end

Andrew Timberlake
http://ramblingsonrails.com
http://www.linkedin.com/in/andrewtimberlake

"I have never let my schooling interfere with my education" - Mark Twain
This topic is locked and can not be replied to.