Hi,

Make a file and put that under lib directory and call it in the model where
u need with 'require' keyword.

2009/12/15 Leonardo Mateo <[email protected]>

> 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-independent-model-validators
> > 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 :)
>
> > 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.
>
> Hope it helps.
>
> --
> 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]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
>


-- 
Regards,

Amit Kumar
Sr. Software Engrr
+91 9890654102
+91 9373087399
Blogsite: http://amitbaraik.blog.co.in/

This e-mail is confidential and may be legally privileged. If you are not
the intended recipient, please notify the sender immediately and delete this
e-mail.

?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

--

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.


Reply via email to