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.
This comment has been removed by the author.
ReplyDeletePre-validating on the server can technically be done with the Model Events. But it's not supported out of the box.
ReplyDeleteIt 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.
This is actually one of the options of validating in the background:
ReplyDeleteIt doesn't include the bindings, but gives idea how it can be done. Easier than I thought actually.
Post the source, please?
ReplyDeleteWhat 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