News for hackers. Stuff that matters.
Re:Sam Stephenson on Pow, CoffeeScript, and the Rails 3.1 As... by devth on Wednesday July 13, 2011 @01:03PM (#2759625)
One thing that wasn't mentioned was template bundling with sprockets. A hack/workaround was posted at https://gist.github.com/989891 but I would really like to know if there is or will be a recommended way of doing it.
Re:Sam Stephenson on Pow, CoffeeScript, and the Rails 3.1 As... by sstephenson on Wednesday July 13, 2011 @05:39PM (#2760804)
The latest Sprockets beta has JST support, heavily inspired by Jammit's approach. Load either the ejs or eco gem in your app, then put a "foo.jst.ejs" or "foo.jst.eco" in your load path. Require it from JS and you'll be able to access the compiled template as JST["foo"].
Re:Sam Stephenson on Pow, CoffeeScript, and the Rails 3.1 As... by daveungerer on Wednesday July 13, 2011 @06:38PM (#2760968)
Cool! I use a version of haml-js that's been modified to work well in the browser. (https://github.com/wintondeshong/haml-js). Jammit allowed me to set the template function as Haml and it just worked, by passing the content of the jst files to the Haml() function. Is there an equivalent in sprockets?

UPDATE: As much as I like Haml, I think I'll just switch to eco, since it seems better integrated for now, and... CoffeeScript! Now all I need is haml-coffeescript / eco-haml. Well it turns out this does exist: https://github.com/9elements/haml-coffee. But I don't know how much work I'd need to do to get it working with the sprockets asset pipeline?

Re:Sam Stephenson on Pow, CoffeeScript, and the Rails 3.1 As... by devth on Wednesday July 13, 2011 @05:42PM (#2760809)
awesome, thanks!