Art Of Programming

musings by Dmytrii Nagirniak

KnockoutJS Validations Screencast

If you wonder how you can use KnockoutJS with Rails in a similar way to Backbone.js or Spine.js then watch the video. It also shows how easy it is to apply client side validations that work alongsite with the server-side validations.

Have a look at the knockout-rails project for more details.


Dmytrii Nagirniak
This is actually one of the options of validating in the background:

It doesn't include the bindings, but gives idea how it can be done. Easier than I thought actually.
Dmytrii Nagirniak
Pre-validating on the server can technically be done with the Model Events. But it's not supported out of the box.

It is a good idea, but there's a bit more complexity involved on both client and server. But I'll gladly accept pull requests to knockout-rails if somebody needs to support that.
Aleksey Gureiev
This comment has been removed by the author.