Has anyone figured out a good solution for shared templates? I don't开发者_运维问答 want to duplicate HTML between client and server. Mustache would be good except for its lack of i18n support (Twitter's contrib is js only). EJS would be perfect if its syntax was directly compatible with ERB, but not quite.
Ideally templates would live in app/views/controller/action.html.erb
(or whatever templating lang) and a templates.js.erb
manifest could bundle those templates up. Having a compatible syntax for a serverside render and clientside render is key to avoiding duplication.
With this pull request haml-js is gaining client-side support which makes it a nice candidate for solving my issue. I will investigate further and see if it meets my needs.
精彩评论