I am looking for a template solution that can work on both server side (like ERB) and client side (like EJS) so I don’t have to write the views twice for use in, say, both Rails and Backbone.
The first that comes to mind is Mustache. Any others?
Anyone doing this successfully ?
EDIT
I keep a compilation Here.
Try Mustache. (Twitter used it in their recent redesign, so they can share templates between server-side Ruby and client-side JavaScript.)
It’s also available in Ruby, JavaScript, Python, Erlang, PHP, Perl, Objective-C, Java, .NET, Android, C++, Go, Lua, ooc, ActionScript, ColdFusion, Scala, Clojure, Fantom, CoffeeScript, D, and for node.js.
(Yes, I know you mentioned it in your question, but this answer has links and stuff.)