cache_digests
cache_digests copied to clipboard
Mention using ERBTracker with HAML in README
My templates are all in HAML and it took me a while to figure out why my dependencies weren't being recognized and how to fix it.
I added an initializer, as suggested by @tim-vandecasteele in #45
Hopeful this will make it more clear to others.
I made some assumptions about why this isn't automatically registered (i.e. that it's not officially supported). If I'm wrong about that, please correct me.
Hey @tim-vandecasteele, I didn't add Slim because I haven't tested it myself.
Can you confirm that it works?
Yes, I confirm it's working for me. Dependencies are properly calculated when checking with the rake task.
+1 for this PR. We lost a few hours that would have been saved by this being called out in the README.
In case anyone is looking for the code for Haml (and other templating languages) support for view template cache digesting in Rails 4, it's referenced in this haml-rails PR: https://github.com/indirect/haml-rails/issues/50
Not trying to troll this post, but I think many may end up here if they're looking for how to get haml digestion to work in Rails as the code was ported from this repo.
+1 for this. Spent some time trying to configure cache_digests and didn't figure out what was up until I check the source.
FYI, @austenito if you're using the latest haml-rails release, it includes the necessary code to ensure cache digesting works properly.
@eprothro thanks I'll give that a shot!
@austenito no problem! Please let us know over on haml-rails if you have issues.
update: https://github.com/indirect/haml-rails/ will now automagically include the initializer code. so if you are using rails you can just put haml-rails in your gemfile and this is taken care of.