jaml
jaml copied to clipboard
How to use this with Rails app?
Hi, I'm pretty impressed with HAML like js rederer. But I'm confused how to use this with Rails app?? Where to put what and how to render on the view as a callback to replace the rendered jaml?
Jaml is entirely JavaScript - I hadn't really thought of it being used as a renderer in Rails. It would be a better fit for client-side rendering or use within a JavaScript framework built on Node or Narwhal or something
You can also look on erector http://github.com/pivotal/erector/tree/master/lib/erector/, that does pretty much the same (and a little more), and has a plugin for rails. The difference is: it is for server-side html generation, while this is for client-side. Pick your poison.
you can drop Node.js Template.js and Jaml.js in /lib/assets/javascripts and require them in application.js file and then you can create template.js in app/assets/javascripts..
PS. I had no luck in using .coffee, something with the indent..