Devise Rails 4 RSpec 3 - Validates email with regex ending by @grenoble-em.com -
i stuck trying forbid user registering on devise without email address ending "@grenoble-em.com". validation add in use model ? cheers
you don't need use regex that, can use index:
"good.mail@grenoble-em.com".index("@grenoble-em.com", -16)
where 16 position end of string , number of letters of searched substring.
Comments
Post a Comment