In my gem, I only want to change the layout in a certain state.
I know that I may have a method for specifying a layout, but how can I point to the current layout in this method? I found out that it _layoutpoints to the name of the layout, but causes a stack overflow if it calls a method that points to the layout.
Here is my code for clarification (in my application controller for engines):
layout :get_layout
def get_layout
current = _layout
request.path_info.include?( '/baco/' ) ? 'baco' : current
end
So, for example: An application with this gem indicates a layout called "qday", now the stone should change the layout if the path includes "baco", but if this does not happen, it should display "qday".
Thank!
source
share