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

Popular posts from this blog

Java 8 + Maven Javadoc plugin: Error fetching URL -

android - How to delete or change the searchview icon inside the SearchView actionBar? -

c++ - Msgpack packing bools bug -