Rails routes wont accept a route if the email is of the form amits321321@sma.com
but this comes out fine amit321321@sma.com
(notice the s).
Inf开发者_StackOverflowact any s present makes the system go haywire...
this is the constraint in the route...
:constraints => { :email => /([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})/ }
Try the following regexp:
/^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
精彩评论