2

I need to validate if input is equal to the some value in database through javascript(without refreshing the page),Is that possible and how do you do that in Rails 3? Thank you in advance.

1 Answer 1

2

You'll want to take a look at client_side_validations gem. This integrates, rails, jQuery, server and client side validation: https://github.com/bcardarella/client_side_validations

Ryan Bates has a good screencast on this topic: http://railscasts.com/episodes/263-client-side-validations

got to about 4 minutes into the video, where he does an ajax request to validate the uniqueness of a username in the database.

and browse the source of his example http://github.com/railscasts/episode-263

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.