1

I would expect simply changing the name from "foo.js.coffee" to "foo.js.litcoffee" or "foo.js.coffee.md" to work, but sadly no.

There is a sprockets issue. Which suggests I should be able to do this in an initializer:

Sprockets.register_engine '.litcoffee', Tilt::CoffeeScriptTemplate::Literate

But I get an error: "uninitialized constant Tilt::CoffeeScriptTemplate::Literate". So I've tried changing it to:

Rails.application.assets.register_engine '.litcoffee', Tilt::CoffeeScriptTemplate

Which allows the app to start, but the links are incorrect "foo.js.litcoffee.js"

Joshua Kolden
  • 416
  • 6
  • 16
  • 1
    I guess you need some gem for that? – Mike Szyndel May 29 '14 at 08:54
  • @MichalSzyndel wow, just wow. – Joshua Kolden May 29 '14 at 16:00
  • Hey, no offence, I couldn't find a lot mentioning that except for this question in google. I think explaining your problem and giving sources helps to debug. As you see people are not fighting over who will answer that so maybe a little more effort on your side is required? – Mike Szyndel May 29 '14 at 17:53
  • Yeah I'm happy to do that, but I'm not sure what's vague about this. The coffeescript compiler supports literate coffeescript out of the box with just a change to the extension, so it is unexpected that it would stop doing that in the context of rails assets. It seems like the question is clear to anyone who knows about the tags #coffeescript #literate-programming, and #ruby-on-rails, but I'm happy to add anything you suggest. – Joshua Kolden May 29 '14 at 21:36

0 Answers0