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

Prevent Stache from automatically using @variables #35

Open
mcmillion opened this issue Feb 12, 2014 · 2 comments
Open

Prevent Stache from automatically using @variables #35

mcmillion opened this issue Feb 12, 2014 · 2 comments

Comments

@mcmillion
Copy link

Is there any way to do this? It seems you can pass in context, but it appear to also be grabbing all @variables automatically, preventing templates from being used as partials in rails views.

@hypomodern
Copy link
Contributor

That's being done in the template renderer. Here's the bit from the Mustache side where that is done: https://github.com/agoragames/stache/blob/master/lib/stache/mustache/handler.rb#L44-L58

It should be smart enough to avoid doing that; if it isn't, I would love a pull request with a failing test, or, failing that, would welcome a step-by-step guide to reproducing the bug :). Thanks for the report!

@mcmillion
Copy link
Author

What's the proper way to pass context into the renderer if I'm calling it like a partial in a view?

= render template: 'whatever', ???

Edit: This is using Handlebars.

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

No branches or pull requests

2 participants