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

Already on GitHub? Sign in to your account

Being able to know what template is being used. #151

maca opened this Issue Jun 14, 2012 · 2 comments


None yet
2 participants

maca commented Jun 14, 2012

Hi, I am trying to make a framework agnostic gem for defining view helpers and I have the need to know what templating engine is being used to tho the capturing, but since tilt evaluates the template code in the context of the object where rendering takes place I've no way of knowing what engine is being used.

sinatra/content_for solves this by defining a @current_engine variable:

But I want a generic/agnostic solution.

This issue is related to rtomayko/tilt#68 that request a tilt implementation for concat/capture.

Here's the hack I am using to access the tilt template by monkey patching Tilt::Template:


Please give consideration to this feature request, or please suggest a better workaround.
I can give it a shot too, what are the mantainers' thoughts on this?



judofyr commented May 2, 2013

Hm. Maybe something like this?

def Tilt.current_template

@judofyr judofyr closed this in 9472c6f May 12, 2013


judofyr commented May 12, 2013

I've introduced Tilt.current_template as an experimental feature.

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