I want to validate a number :value to be within 1 or 2
:value
validates :value, :format => { :with => /1|2/, :message => \"Select number..\" }
if you want it to be a number within 1 and 2 ( 1.5, 1.6839749, etc ) do
validates_numericality_of :value, :greater_than_or_equal_to => 1, :less_than_or_equal_to => 2, :message => "blah"
may not be what you are looking for but is worth noting,