Skip to content

Instantly share code, notes, and snippets.

@chrisdarroch
Created July 14, 2010 04:51
Show Gist options
  • Save chrisdarroch/475042 to your computer and use it in GitHub Desktop.
Save chrisdarroch/475042 to your computer and use it in GitHub Desktop.
<html>
<body>
<div id="wrapper">
<%# Huzzah! I can render messages way outside the bounds of my content structure! %>
<div id="messages">
<%= yield :messages %>
</div>
<section id="main">
<nav class="sidebar">
...
</nav>
<section id="content">
<%= yield %>
</section>
</section>
</div>
</body>
</html>
<%= form_for @person do |form| %>
<%= render :partial => "form", :locals => { :form => form } %>
<%- end %>
<% content_for :messages do %>
<!-- Aha! I'm a form-specific piece of information and I *refuse* to be contained by your form, nor your rigid markup structure! -->
<%= form.error_messages %>
<%- end %>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment