Skip to content

Instantly share code, notes, and snippets.

@danneu
Forked from Fire-Dragon-DoL/base.html.erb
Last active December 17, 2015 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danneu/5586514 to your computer and use it in GitHub Desktop.
Save danneu/5586514 to your computer and use it in GitHub Desktop.
(In views/layouts/application.haml)
%html
= yield :application_with_nested_layout
= yield
class ControllerA
layout :application_with_nested_layout
end
class ControllerB
# Regular application layout
end
(In views/layouts/application_with_nested_layout.haml)
- content_for :application_with_nested_layout do
- if content_for? :whatever
= yield :whatever
= render file: "layouts/application"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment