I'm using devise gem for my rails3 project. I need to allow (!@#$%^&*-+?<>,.;:"'\|) these special characters in my password. Can any one help me how to write validation for this?
Thanks in advance.
you can validate like this
validates_format_of :password, :with => /^[A-Za-z0-9. ! @ # $ % ^ & * ( ) _ - + = ]*\z/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With