i send an form remotely and wanted to add a validation to it. this is in my model:
validates :email, :presence => true, :email => true
validation works fine, when email is valid it adds it to the database, if not, then not. my problem is, whenever i submit the form, it renders my subscribe.js file:
$('.form').html("<p><strong>Thank you for your interest!<br />We'll keep you up-to-date.</strong></p>");
how can i tell rails, that if the email adress is unvalid, it should render another .js file? or is there another way?
thank you!