I’m trying to extract the name of the template I am currently to be
yielding from my layout, but with no success. Does anyone know how to do
that?
Suppose I am calling the MainController#create action. On failure to
create my erm…Main object it re-renders the ‘new’ template. I’d like
to know in the layout which template I am going to render so that I can
access a help system which can dynamically include help information
depending on which template I am rendering at the time. Then no matter
what controller or what action I am calling at the time, as long as I
have the template name I can display the same information.
Thanks for the help Gavin, it wasn’t quite what I was looking for. Its a
bit of a weird one. Given a particular layout I want to know the name of
the template that is used in the
<%= yield %>
Which is a bit weird, I know. I would imagine that the results of the
yield are just a big string, by which time its a bit late to work out
what the name of the template I just rendered was.