MemoMemo
Validate on ActiveRecord
最終更新:
kiminori_hirose
-
view
一覧
| validates_acceptance_of | 同意 | :on, :message, :if, :accept |
| validates_associated | 関連 | :on, :message, :if |
| validates_confirmation_of | 確認 | :on, :message, :if |
| validates_each | 要素 | :on, :if, :allow_nil |
| validates_exclusion_of | 範囲外 | :on, :message, :if, :in(必須), :allow_nil |
| validates_format_of | 正規表現 | :on, :message, :if, :with(必須) |
| validates_inclusion_of | 範囲 | :on, :message, :if, :in(必須), :allow_nil |
| validates_length_of | 長さ | :on, :message, :if, :minimun, :maximun, :within, :in, :allow_nil, :wrong_length, :too_long, :too_short |
| validates_numericality_of | 数値 | :on, :message, :if, :allow_nil, :only_integer |
| validates_presence_of | 存在 | :on, :message, :if |
| validates_uniquness_of | 一意性 | :on, :message, :if, :scope, :case_sensitive |
validates_acceptance_of
class Entry < ActiveRecord::Base
validates_acceptance_of :accepted, :accept=>'ok'
end