File: article.rb

package info (click to toggle)
libgettext-rails-ruby 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,384 kB
  • ctags: 383
  • sloc: ruby: 1,042; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 706 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Article < ActiveRecord::Base
  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 => N_("can't be empty")
#  validates_length_of :description, :minimum => 10, :message => N_("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 => N_("%{fn} can't be empty!")
#  validates_length_of :description, :minimum => 10, :message => N_("%{fn} is too short (min is %d characters)")
  #
end