Skip to content

Instantly share code, notes, and snippets.

@ballpointcarrot
Created March 3, 2011 00:34
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 ballpointcarrot/852093 to your computer and use it in GitHub Desktop.
Save ballpointcarrot/852093 to your computer and use it in GitHub Desktop.
Examle Rails locale YAML to customize Form Label names
~ form_for(@race) do |f|
~ if @race.errors.any?
#error_explanation
%h2 #{pluralize(@race.errors.count, "error")} prohibited this race from being saved:
%ul
~@race.errors.full_messages.each do |msg|
%li= msg
.field
=f.label :name
%br
=f.text_field :name
.field
=f.label :date
%br
=f.datetime_select :date
.field
=f.label :details
%br
=f.text_area :details, :rows => 3
.actions
=f.submit
en:
hello: "Hello world"
helpers:
label:
race:
name: "Race Name"
date: "Race Date"
details: "Race Details"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment