How can I send an email address to a Rails controller, as a param, via jQuery, to check whether it already is registered (as part of validation for a registration form)? When I try to parameterize it with jQuery, a .
remains in the parameter and Rails truncates the parameter.
I wrote a simple function to substitute in a pattern that I then replace in the controller, but I can't shake the feeling that I'm doing this the wrong way. Is there a way to encrypt the email before sending it as a parameter and then decrypt it in the controller so that I can use it in a query?
Basically, I'm trying to do some simple pre-validation so that if a user attempts to register using an email that already is registered that they will receiving a warning before submitting the form, with a link to recover their password.