Sha256: d8ce45196845588553b4a17efb1bd42fdad11c80a4cfe2d926b1427c7c0ee422

Contents?: true

Size: 734 Bytes

Versions: 4

Compression:

Stored size: 734 Bytes

Contents

class Article < ActiveRecord::Base
  # With default error messages.
  validates_presence_of :title
  validates_length_of :description, :minimum => 10


  # With your own message with L10n. 
  # old style(Backward compatibility).
  # blog.po in RAILS_ROOT/po/*/ is used.
#  validates_presence_of :title, :message => _("can't be empty")
#  validates_length_of :description, :minimum => 10, :message => _("is too short (min is %d characters)")

  # new style (you can use %{fn} and %d freely in the message)
  # blog.po in RAILS_ROOT/po/*/ is used.
#  validates_presence_of :title, :message => _("%{fn} can't be empty!")
#  validates_length_of :description, :minimum => 10, :message => _("%{fn} is too short (min is %d characters)")
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gettext-1.1.1-mswin32 samples/rails/app/models/article.rb
gettext-1.1.0-mswin32 samples/rails/app/models/article.rb
gettext-1.1.0 samples/rails/app/models/article.rb
gettext-1.1.1 samples/rails/app/models/article.rb