Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement global context server mixin feature #87

Merged
merged 3 commits into from
Apr 11, 2013

Conversation

thedeeno
Copy link
Collaborator

An implementation of the feature discussed in #85.

Add the concept of a global context asset. This is a special asset that
contains extensions to `HAML.globals`. This asset is mixed into the
javascript environment before compilation on the server - allowing us
to share custom `HAML.globals` on both client and server.

The path for this asset is configurable.
When the global_context_asset changes rails should recompile stale hamlc
templates. By default, rails only recompiles templates if they're
touched, which is problematic since it's the helper not the template that
changed.

This commit patches rails so that it automatically recompiles and touches
hamlc templates when the global_context_asset changes from underneath it.
@netzpirat netzpirat merged commit ca289a3 into emilioforrer:master Apr 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants