Skip to content

Instantly share code, notes, and snippets.

@Zelnox
Created February 7, 2013 17:47
Show Gist options
  • Save Zelnox/4732717 to your computer and use it in GitHub Desktop.
Save Zelnox/4732717 to your computer and use it in GitHub Desktop.
Somewhere in your layouts/application.html.erb
<%= content_for?(:content) ? yield(:content) : yield %>
<% content_for :content do -%>
<%= content_for?(:dashboard_content) ? yield(:dashboard_content) : yield -%>
<% end -%>
<%= render :template => "layouts/application" %>
View that uses the dashboard layout would define
<% content_for :dashboard_content do -%>
Ponies!
<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment