Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Template engine for Ruby and Javascript

We are building a web page with hashtag navigation. There is lots of data, which comes in as JSON and we use client-side templates (jQuery) to render it. So what are the options for reusable templates on both client-side and server-side (Ruby on rails)? Because we would like to have an option to fallback to a non-hashtag url and in this case server should render the data.

I've seen Mustache.js, but it has poor support for iterating (can't get index) or nested templates and haml-js is not an option because it uses custom tags for loops.

There are also couple of workarounds with using javascript engine on server side, but I'm not sure this will be a good decision.

Any suggetions? Thanks.

like image 631
spacevillain Avatar asked Jul 29 '11 13:07

spacevillain


1 Answers

There are a few projects that claim to make this possible. The latest one that I've heard of is Ice. Its README mentions a few others that you might want to check out too. I haven't personally tried any of these, so I can't give you a recommendation as to how well they work, but I'd love to hear about your experiences with them as I might be attempting this in the near future as well.

like image 134
David Avatar answered Sep 20 '22 12:09

David