So, you render a page and give it to the browser.  Then, you want to update parts of it as a result of changing data model.

Do you:

  1. Have your jQuery update just the relevant divs, coupling your ui update code to your template layout?
  2. Re-write your views again in a js-friendly template language, duplicating effort and leading to subtle incompatibilities?
  3. Have the server return html snippets, leading to issues down the road when you want to update multiple parts of the page as a result of the request?
  4. Just render the same template client-side, because you're using the new shared-views package?
If you want to use the sample templates on the client and the server, my new shared-views package ( https://github.com/aaronblohowiak/shared-views ) will help you to build out the infrastructure that lets you do just that.  It isn't quite "batteries-included" -- you'll have to bring your own template language -- but I have written a simple example that shows it in use with haml-js.

This is one step closer to being able to render a page for delivery to the user and then let the user's browser just talk JSON with the server from there on out, updating the page with the same templates that were used in the initial page rendering.

Let me know if you have any questions - aaron.blohowiak@gmail.com