Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created April 4, 2013 20:03
Embed
What would you like to do?
<%= form_for(@project) do |f| %>
<% if @project.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@project.errors.count, "error") %>
prohibited this project from being saved:</h2>
<ul>
<% @project.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
&lt;% end %&gt; <co />
&lt;p&gt;
&lt;%= f.label :name %&gt;&lt;br /&gt;
&lt;%= f.text_field :name %&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;%= f.label :description %&gt;&lt;br /&gt;
&lt;%= f.text_field :description %&gt;
&lt;%= f.submit %&gt;
&lt;% end %&gt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment