开发者

Rails 3 custom class NoMethodError error

I have added a custom class to the lib folder and can initialize the class and call an attribute but can not call a method from the class without getting the following error

unde开发者_如何转开发fined method `colour' for #

Any ideas what I'm doing wrong?

I'm using rails 3


Can we see some code? Which version of rails?

My understanding is that not everything from lib is automatically loaded in rails 3.

See this post:
Best way to load module/class from lib folder in Rails 3?

Why not move the class to the models folder? I don't use lib so much anymore...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜