search for: too_short

Displaying 6 results from an estimated 6 matches for "too_short".

2006 Jul 16
0
Problems with validates_lenght_of
...ence_of :password, :password_confirmation, :login, :email, :on => :create validates_length_of :password, :within => 6..20, :too_long => "must be shorter", :too_short => "must be longer", :on => :create validates_length_of :password, :within => 6..20, :too_long => "must be shorter", :too_short => "must be longer",...
2011 Apr 18
2
acts_as_commentable validations
...y Post model and it''s working great. Problem is users are able to create a "blank" comment. I''ve added the following validations in the comment.rb file generated by acts_as_commentable to limit the comment length: [code] validates_length_of :comment, :minimum => 3, :too_short => "must be at least {{count}} words.", :tokenizer => lambda {|str| str.scan(/\w+/) } validates_length_of :comment, :maximum => 200, :too_long => "must be shorter than {{count}} words. Make sure there are no links or elements.", :tokenizer => lambda {|str| str.sc...
2006 Aug 08
2
validate data
Can anyone help me?? I validate a form-field: protected def validate errors.add(:name, "should be longer than 2 chars") unless name.length <= 2 end I want to check the variable name. It should have a size over 2 characters. But my function "validate" doesn''t run! Why ??? -- Posted via http://www.ruby-forum.com/.
2006 Mar 16
0
validating presence of a tag
...validates_length_of :question_text, :maximum=>150, :message=>"must be less than 150 characters." end Class Tag < ActiveRecord Base validates_presence_of :name validates_length_of :name, :in => 1..20, :too_long => "Tag name too long - max 20 characters", :too_short => "Tag must have a name" end Suggestions are appreciated. Steve http://www.smarkets.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060316/d191d8f6/attachment.html
2006 Mar 17
0
validations using acts_as_taggable
...de me an example of how they are displaying validation errors when saving a tag using Demetrius''s (not DHH''s) act_as_taggable plugin? For example, the tag model has a :validates_length_of :name, :in => 1..30, :too_long => "Tag name too long - max 30 characters", :too_short => "Tag must have a name" If a user inputs a tag longer than 30 characters, how are you displaying the error_messages_on :tag messages? Thanks, Steve http://www.smarkets.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/...
2005 Jan 17
5
how to override rails errors messages?
hi, how can i override rails errors mesages (that are in english) to display them in an other language? thanks hangon