Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Mention using ERBTracker with HAML in README#46

Open
nickurban wants to merge 2 commits intorails:masterfrom
nickurban:master
Open

Mention using ERBTracker with HAML in README#46
nickurban wants to merge 2 commits intorails:masterfrom
nickurban:master

Conversation

@nickurban
Copy link
Copy Markdown

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.

@nickurban
Copy link
Copy Markdown
Author

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a similar line for Slim

  # Or enable experimental Slim support with the ERB Dependency Tracker
  CacheDigests::DependencyTracker.register_tracker :slim, CacheDigests::DependencyTracker::ERBTracker

@nickurban
Copy link
Copy Markdown
Author

Hey @tim-vandecasteele, I didn't add Slim because I haven't tested it myself.

Can you confirm that it works?

@tim-vandecasteele
Copy link
Copy Markdown

Yes, I confirm it's working for me. Dependencies are properly calculated when checking with the rake task.

@eprothro
Copy link
Copy Markdown

eprothro commented Aug 5, 2013

+1 for this PR. We lost a few hours that would have been saved by this being called out in the README.

@eprothro
Copy link
Copy Markdown

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: haml/haml-rails#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.

@austenito
Copy link
Copy Markdown

+1 for this. Spent some time trying to configure cache_digests and didn't figure out what was up until I check the source.

@eprothro
Copy link
Copy Markdown

FYI, @austenito if you're using the latest haml-rails release, it includes the necessary code to ensure cache digesting works properly.

@austenito
Copy link
Copy Markdown

@eprothro thanks I'll give that a shot!

@eprothro
Copy link
Copy Markdown

@austenito no problem! Please let us know over on haml-rails if you have issues.

@jjb
Copy link
Copy Markdown

jjb commented Jan 19, 2015

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants