http://www.gotapi.com/rubyrails
such nach der methode
dann findest du das hier:
class Person < ActiveRecord::Base
validates_length_of :first_name, :maximum=>30
validates_length_of :last_name, :maximum=>30, :message=>“less than
%d
if you don’t mind”
validates_length_of :fax, :in => 7…32, :allow_nil => true
validates_length_of :phone, :in => 7…32, :allow_blank => true
validates_length_of :user_name, :within => 6…20, :too_long => “pick
a
shorter name”, :too_short => “pick a longer name”
validates_length_of :fav_bra_size, :minimum=>1, :too_short=>“please
enter at least %d character”
validates_length_of :smurf_leader, :is=>4, :message=>“papa is
spelled
with %d characters… don’t play me.”
end
validates_length_of :user_name, :within => 6…20, :too_long => “pick a
shorter name”, :too_short => “pick a longer name”
macht ja auch nur sinn, dass man ne message für zu lang und zu kurz
angibt…
die docu sollte solche fragen ohne weiteres erklären…
gruß
manuel
Am 28.05.2008 um 11:53 schrieb Rene P.:
validates_length_of