Skip to content

Instantly share code, notes, and snippets.

@JonasNielsen
Forked from JeanMertz/haml.html.haml
Created August 3, 2010 10:59
Show Gist options
  • Save JonasNielsen/506184 to your computer and use it in GitHub Desktop.
Save JonasNielsen/506184 to your computer and use it in GitHub Desktop.
= form_for([:admin, @stencil]) do |f|
- if @stencil.errors.any?
#error_explanation
%h2
= pluralize(@stencil.errors.count, "error")
prohibited this stencil from being saved:
%ul
- @stencil.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :client
%br/
= f.select(:client_id, Client.find(:all).collect {|c| [ c.name, c.id ] })
= f.fields_for :stencil_config do |stencil_config|
.field
= stencil_config.label :title
%br/
= stencil_config.text_field :title
.field
= stencil_config.label :description
%br/
= stencil_config.text_area :description
.actions
= f.submit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment