Thursday, 22 December 2011

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.

5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. 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.

    ReplyDelete
  3. 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.

    ReplyDelete
  4. Post the source, please?

    ReplyDelete
  5. What source code? The `knockout-rails` is published as a gem and I published the code on Github with the link in the post above.

    ReplyDelete