Closed pablofierro closed 11 years ago
Sorry, browsing through the source code I found the Sprockets processor is only registered when using with Rails.
@pablofierro I'm having the same problem with middleman 3.1.4, but your solution is giving me undefined method 'register_engine' for Middleman::Sprockets:Module?
Is this still a working solution for you? Thx!
@manufaktor Yes, I'm still using this on the same version as you are running(3.1.4), try just copying and pasting the code above your comment. It's working like a charm for me.
@manufaktor look at the error you are getting closer. It is saying that the Sprockets
isn't available. Make sure you can require it and it is available.
@dnagir yeah I tried that like it's done in engine.rb by requiring sprockets and sprockets/engines, but no luck. Anyway, I guess this has nothing to do with ruby-haml-js
Did you solved this issues @manufaktor? I'm running exactly the same issues with middleman, when trying to use ruby-haml-js... I'd be glad for your solution!
nope, could not solve it, switched to ejs because I had to get stuff done. :(
Actually, i found now, after some more searching in the last hours the following: Put :: before the Code and integrate into the config.rb from your middleman-project like this:
::Sprockets.register_engine '.hamljs', ::RubyHamlJs::Template
Worked for me, but i'm not so happy with the haml-js notation... trying out more examples now, where the limitations are.
Hope I could help you, thanks for answering so fast!
@bluerouse yes, that's the solution I entered in my closing comment. '::' is to access the Sprockets namespace.
Hello, awesome gem.
I read this works with or without Rails asset pipeline, I'm working on a project with Middleman which uses sprockets but I can't get the .jst.hamljs templates to be processed by the gem.
The template text shows up in the JST function but it wasn't processed as it's showing haml markup.
Any ideas why this is happening or is there something I need to do to set it up outside of Rails ?
Cheers