I have two registration forms: one that can register with any email address and the other with just one specific domain. How to allow that from the User.rb model?
Something like this may work:
validates_format_of :email, :with => /.io/
But because I have two registration forms and the url for that form has an id of 2:
validates_format_of :email, :with => /.io/ if params[id] == 2
I do understand that params is not available in the model but based on what I want to achieve, how to accomplish this?
Basically form with id = 1 can register with any email. Form with id = 2 can only register with a .io email address (domain).