Created
November 24, 2010 19:39
-
-
Save volh/714243 to your computer and use it in GitHub Desktop.
rails 3 engine helper to render inside base application layout, even if there is no content_for in it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updated from several code snippets | |
def base_layout(layout="application") | |
@_content_for[:layout] = self.output_buffer | |
self.output_buffer = render :file => "layouts/#{layout}" | |
end | |
# just add <%= base_layout %> at the end of your engine layout. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment