Skip to content

Instantly share code, notes, and snippets.

@erich
Created May 15, 2012 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erich/2700599 to your computer and use it in GitHub Desktop.
Save erich/2700599 to your computer and use it in GitHub Desktop.
= form_for [@user, @task], :html => { :class => 'form-inline' } do |f|
-if @task.errors.any?
#error_explanation
%h2= "#{pluralize(@task.errors.count, "error")} prohibited this task from being saved:"
%ul
- @task.errors.full_messages.each do |msg|
%li= msg
== #{f.label :name} #{f.text_field :name}
== #{f.label :deadline} #{f.text_field :deadline}
.actions
= f.submit 'Save'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment