Skip to content

Instantly share code, notes, and snippets.

@stijlist
Created June 10, 2012 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stijlist/2906611 to your computer and use it in GitHub Desktop.
Save stijlist/2906611 to your computer and use it in GitHub Desktop.
Trying to add CSS classes to form_for
= form_for (@user, :html => {:class => "well"}) do |f|
-if @user.errors.any?
#error_explanation
%h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:"
%ul
- @user.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :fname
= f.text_field :fname
.field
= f.label :lname
= f.text_field :lname
.field
= f.label :email
= f.text_field :email
.field
= f.label :password
= f.text_field :password
.actions
= f.submit 'Save'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment