2009/10/6 Pål Bergström <[email protected]>:
>
> Sijo kg wrote:
>> Hi Pål Bergström
>>
>>   Can you paste the code?
>>
>> Sijo
>
> It's just a test code. In the file /lib/random.rb I have:
>
> class Random
>
>  def test
>    "test"
>  end
>
> end
>
> In the controller I try to call:
>
> @test = Random.test

If you want to call it like that you must make test a class method
rather than an instance method, so it must be
def self.test
..

Colin

> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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