I agree and my model already had a validates_length_of so I modified
the proposed regex to eliminate the length check.
Discussing this with my partner we decided to allow numbers, letters,
and underscore () so I am going to try the regex
We don’t care if the first character is a letter, number, or
underscore, only that these are the only characters allowed anywhere
in the username. So “_username”, “user_name”, and “1user_name” should
all be valid.
Think this should work? I don’t have access to the site to test it
until I get home tonight.
I had never noticed that validates_length_of supports two error
messages, one for too short, and one for too long. I’ll have to
implement that in my code tonight as well.
Now if I could only find a non-ugly way to sort the error messages so
they match the order of the form fields I’d be all set.