Skip to content

Instantly share code, notes, and snippets.

@dankozlowski
Created June 21, 2011 06:21
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 dankozlowski/1037335 to your computer and use it in GitHub Desktop.
Save dankozlowski/1037335 to your computer and use it in GitHub Desktop.
= form_for @user_comment do |f|
-if @user_comment.errors.any?
#error_explanation
%h2= "#{pluralize(@user_comment.errors.count, "error")} prohibited this user_comment from being saved:"
%ul
- @user_comment.errors.full_messages.each do |msg|
%li= msg
.field
= f.hidden_field :admin_id, :value => current_admin.id
= f.hidden_field :user_id, :value => @user.id
.field
= f.label "New Comment:"
%br
= f.text_area :content, :class => "width-14"
.actions
= f.submit 'Save Comment'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment