I would like to serve client side templates that have been pre-processed through HAML. I have tried using the haml_assets gem and adding the following code to an initializer:
Rails.application.assets.register_engine ".haml", Tilt::HamlTemplate
Both of these methods serve the raw HAML and not compiled HAML when I access the asset. How can I add HAML to the pipeline?
Just to clear things up, since I find the current answers a bit irritating (led me to the right direction though)
It works, if i have this line in an initializer file:
# config/initializers/haml_assets.rb
Rails.application.assets.register_engine '.haml', Tilt::HamlTemplate
Throw your haml files into the assets folder, for example:
# app/assets/templates
Do not use the haml_asset gem though!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With