jaml icon indicating copy to clipboard operation
jaml copied to clipboard

How to use this with Rails app?

Open millisami opened this issue 15 years ago • 3 comments

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?

millisami avatar Jan 16 '10 17:01 millisami

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

edspencer avatar Jan 20 '10 22:01 edspencer

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.

danielribeiro avatar May 22 '10 18:05 danielribeiro

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..

jb-san avatar Mar 08 '12 12:03 jb-san