Skip to content

Instantly share code, notes, and snippets.

@ajwinn
Created December 11, 2012 17:43
Show Gist options
  • Save ajwinn/4260554 to your computer and use it in GitHub Desktop.
Save ajwinn/4260554 to your computer and use it in GitHub Desktop.
= form_for @post do |f|
- if @post.errors.any?
#error_explanation
%h2= "#{pluralize(@post.errors.count, "error")} prohibited this post from being saved:"
%ul
- @post.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :name
= f.text_field :name
.field
= f.label :title
= f.text_field :title
.field
= f.label :content
= f.text_area :content
.actions
= f.submit 'Save'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment