Hi to Ruby and Rails group! I am new to the ROR . I ahev some doubts 1.Can we write the reguller expressions controller! 2.I have added the some controles in the rhtml file.(with out database fileds) I want to wirte the validations for these text fields in the model Is it Possible? Give me any reference? 3.In how many ways can we write the validations? Thanks and Regards, Kumar -- Posted via http://www.ruby-forum.com/.
There is many different validations that are available to you out of the box. The one for use with regular expressions is validates_format_of docs at http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M000817 If none of those meet your exact needs you can always write your own with the validate method On 5/3/06, kumar <kaumar@kumar.com> wrote:> > Hi to Ruby and Rails group! > > I am new to the ROR . > > I ahev some doubts > > 1.Can we write the reguller expressions controller! > > 2.I have added the some controles in the rhtml file.(with out database > fileds) > > I want to wirte the validations for these text fields in the model > > Is it Possible? > > > Give me any reference? > > > 3.In how many ways can we write the validations? > > > Thanks and Regards, > Kumar > > > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060503/8eb4c00f/attachment.html
kumar wrote:> Hi to Ruby and Rails group! > > I am new to the ROR . > > I ahev some doubts > > 1.Can we write the reguller expressions controller! > > 2.I have added the some controles in the rhtml file.(with out database > fileds) > > I want to wirte the validations for these text fields in the model > > Is it Possible? > > > Give me any reference? > > > 3.In how many ways can we write the validations? > > > Thanks and Regards, > KumarHi I have also same doubt ,can we write the validations for non database fileds in model Please give me reference Thnks -- Posted via http://www.ruby-forum.com/.
> Hi I have also same doubt ,can we write the validations for non > database fileds > in model > > Please give me reference > > ThnksYes you can I did just that in this peice of code http://www.metaspot.net/gms/browser/trunk/app/models/user.rb -- Posted via http://www.ruby-forum.com/.