What is the best/easy way to validate an email address in Ruby?

前端 未结 10 921
刺人心
刺人心 2020-12-13 06:40

What is the best/easy way to validate an email address in ruby (on the server side)?

10条回答
  •  误落风尘
    2020-12-13 06:49

    You can use

    <%=email_field_tag 'to[]','' ,:placeholder=>"Type an email address",:pattern=>"^([\w+-.%]+@[\w-.]+\.[A-Za-z]{2,4},*[\W]*)+$",:multiple => true%>
    

提交回复
热议问题