Search code examples
ruby-on-railsvalidationformsruby-on-rails-3ujs

Rails 3 UJS dry Client + Server Side form validation


Form validation with jQuery is as easy as adding a classname to a field. Form validation with rails is as easy as putting a condition in to your controller (and/or model).

I figure there should be a way to write the validations once and have them applied both client and server side. I've always been a fan of writing my own javascript, but with rails3 unobtrusivity UJS might be well worthwhile here if it can accomplish this.

Thanks!!


Solution

  • Does JS validations, including some neat stuff ajax for validating uniqueness.

    https://github.com/bcardarella/client_side_validations

    http://railscasts.com/episodes/263-client-side-validations