Displaying 4 results from an estimated 4 matches for "validates_lenght_of".
2006 Jul 16
0
Problems with validates_lenght_of
I''m building a login system, and I want users to be able to update their
password, first name and last name after signing up. So, when signing up
password can''t be nil, and it must be between 6..20 characters long. However,
on update, the user can choose to leave the password field empty (but fill in
other stuff, like first name) and then I want the User model to not update
2005 Aug 19
2
data validation
...39;
has_and_belongs_to_many :categories, :join_table => ''company_to_category'',
:foreign_key => ''company_id'',
:association_foreign_key => ''category_id''
validates_presence_of :name
validates_uniqueness_of :name
validates_lenght_of :name, :maximum => "20" ,:message => "too long"
end
The presence_of and the uniqueness_of work fine, but it doesn''t throw any error
when the name atribute is longer than 20..
Is there any problem with it? Can I combine validate rules however I want to, or...
2005 Sep 27
2
No Custom Validation
Hi,
Correct me if I am wrong but there doesn''t seem to be an easy way to add
validation outside the pre-built ones (validates_presence_of,
validates_lenght_of, etc.).
Ideally there should be something like:
Class Person < ActiveRecord::Base
validates :my_method, :on => create, :message => ''was not valid''
def my_method(param)
false unless
param ...
true
end
end
2006 Feb 04
0
Easy way to force using jlenght and no lenght in validations
I need validates_lenght_of validates lenght of UTF-8 strings and not
just byte counting. Is there easier way than create my own validation
method just validates_jlenght_of?
--
Posted via http://www.ruby-forum.com/.