Re: Custom class

Leonardo Mateo
Tue, 06 Oct 2009 09:17:53 -0000

2009/10/6 Pål Bergström
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:
>
> Leonardo Mateo wrote:
>> 2009/10/6 P�l Bergstr�m
<rails-mailing-list-ARtvInVfO7m5VldFQK4jKA@public.gmane.orgt>:
>>>
>>> Where do I put a custom class?
>> It depends on what is it''s purpose but, usually,
you''ll put them on
>> your models directory.
>>
>>> How do I use it?
>> Just like you use every class.
>>
>> --
>> Leonardo Mateo.
>> There''s no place like ~
>
> I can''t make it work. I''ve put in the lib directory. Do I
need to make a
> require or something? I get an error "private method `test''
called for
Of course you have to require them. Probably on your environment.rb if
you want to require it only once, but you should see if that worth the
payload. If the class is "too heavy"you should require it only when
you''re going to use it.


--
Leonardo Mateo.
There''s no place like ~