views:

67

answers:

0
class User
  include ActiveModel::Validations
  validates_presense_of :first_name
  validates_length_of :last_name, :in => 3..20, :too_long => "pick a shorter last name", :too_short => "pick a longer last name"

  attr_accessor :first_name, :last_name
end

How do you

  1. localize error message(s) for :first_name
  2. localize error message(s) for :last_name