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

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -