For some reason my login controller refuses to access a method
i have defined for another class. This is remedial stuff but my
searches haven't cleared up the issue. It is creating the model
but can't access the method. The method is NOT protected or
private. Any thoughts? The error:
undefined method `try_to_login' for #<Person:0x37ed3f0>
#take user object and 'try to log in' (see person model)
logged_in_person = @person.try_to_login
You're calling #try_to_login as an instance method of @person instance.
class Person < ActiveRecord::Base
You've defined #try_to_login as a class method. Furthermore
inside the #try_to_login code, self.name and self.password will
be calls to class methods Person#name and Person#password
and not instance methods.
So maybe you have to change #try_to_login to be an