Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1 shared client/server templates with support for i18n

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.

like image 219
devth Avatar asked Nov 13 '22 20:11

devth


1 Answers

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.

like image 58
devth Avatar answered Dec 19 '22 00:12

devth