This project is archived and is in readonly mode.
ActionView::Base @_render_stack is not being filled on edge
-
josh
- State changed from new to wontfix
Using @template always points the the current template being rendered. So after you return to the controller, no template is "currently" being render. It is only for use inside the template.
-
José Valim
So there is any way on Rails 2.3, without monkey patching, to know which template was rendered? I need its filename... :)
-
josh
We'll its hard to say "which template was rendered" since most templates rendered other nested templates. You probably don't want the "last" template cause that could be some partial, I guess your looking for the "first" rendered template, but that isn't directly known by AC.
-
José Valim
Makes sense! :) What I want was usually kept in @_first_render, but it's long gone right?
-
josh
Hrm, I was under the impression that was a testing only hack.
Just curious why you need this. Then we should consider adding this as a public feature for controllers.
-
José Valim
I use it in Rails Footnotes plugin. It adds some links at the end of each view, which makes possible to open your controller or your view file in your editor (Textmate, for example) with just one click. It also adds some debug information, as queries, filters, etc.
I was using the template in @_first_render to get the view filename to create the link.
Screenshot here:
http://1.bp.blogspot.com/_CVPxcH...
Github here: