We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
If you use variables in validation regexp like this one:
validates :username, :format => {:with => /^#{USERNAME_REGEXP}$/ }
then you will get JS error like this in firebug:
invalid quantifier
or this in Chrome:
Uncaught SyntaxError: Invalid regular expression: /^(?-mix:[A-Za-z0-9\_][A-Za-z0-9\-\_\.]+)$/: Invalid group
To avoid this, use #source method of Regexp class on included variable:
#source
Regexp
validates :username, :format => {:with => /^#{USERNAME_REGEXP.source}$/ }
There was an error while loading. Please reload this page.