ActionView::Layouts

module ActionView::Layouts

Included modules:
ActionView::Rendering

Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in repeated setups. The inclusion pattern has pages that look like this:

<%= render "shared/header" %>
Hello World
<%= render "shared/footer" %>

This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose and if you ever want to change the structure of these two includes, you'll have to change all the templates.

With layouts, you can flip it around and have the common structure know where to insert changing content. This means that the header