开发者

Rails 3.1 shared client/server templates with support for i18n

开发者 https://www.devze.com 2023-03-20 08:54 出处:网络
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 (Twitt

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消