Skip to content

Instantly share code, notes, and snippets.

@samrose
Created December 23, 2011 22:17
Show Gist options
  • Save samrose/1515518 to your computer and use it in GitHub Desktop.
Save samrose/1515518 to your computer and use it in GitHub Desktop.
form
= form_for @forum_topic do |f|
-if @forum_topic.errors.any?
#error_explanation
%h2= "#{pluralize(@forum_topic.errors.count, "error")} prohibited this forum_topic from being saved:"
%ul
- @forum_topic.errors.full_messages.each do |msg|
%li= msg
= hidden_field_tag "forum_topic[forum_id]", params[:forum_id]
.field
= f.label :title
= f.text_field :title
.field
= f.label :description
= f.text_area :description
.actions
= f.submit 'Save Forum Topic'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment