On Tue, Dec 15, 2009 at 9:54 AM, radu puspana <[email protected]> wrote: > > > On Dec 15, 2:42 pm, Leonardo Mateo <[email protected]> wrote: >> On Tue, Dec 15, 2009 at 9:32 AM, radu puspana <[email protected]> wrote: >> > sry folks, i forgot to put up the link, sry my bad : >> >http://ryandaigle.com/articles/2009/8/11/what-s-new-in-edge-rails-ind... >> > thx to Leonardo Mateo for answering, and i would like the next >> > response if it comes, to be a well explained one, >> >i;m a RoR noob :( , >> >> That means that you're starting to walk the right way, and that's no >> reason to :(, so be :) > > Thx for the nice thought :) i really appreciate it, never know that > walking can be so hard :) That's because you don't remember when you were a baby :P
> >> > like, if i put the code in the lib/ should i create a file or somentih >> > with that class, and how should i link it with the validator in my >> > model?? >> >> Of course you should create a file, you can't just throw the code in a >> directory unless it is on a file. :P >> After that you should make sure that file is 'required' before you try >> to use it. For this you can require it on the model you're going to >> use it or, you can require it on application.rb for it to be available >> for all the models. That will depend on your desing. > > so i put the class EmailValidator < ActiveRecodr::validate in a file > called say, email_validate in the lib directory? lib/email_validate.rb > after that pls tell me the steps to make this class and it;s method, > available to all my models In application.rb, put: require 'email_validate' -- Leonardo Mateo. There's no place like ~ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

