I have model named TMem
:
class TMem < ActiveRecord::Base
# attr_accessible :title, :body
def expense
'Test'
end
end
When I try to execute the command in rails c
:
TMem.find(1).expense
I got the error :
NoMethodError: undefined method `expense' for #<TMem:0xb5fb97c>
Why I got this error?