Hi
I would like to know the difference between writing our own class
file(or module) in lib folder and models folder (Or any other folder).
Actually what is the use of this lib folder in rails..Cant I write the
same in models folder (not inheriting from ActiveRecord class)
You could but if it's not a model, why put it in a folder labelled models?
It's purely for code organisation, and Rails uses the folder names for
some of it's auto load magic.
I use a library called simple_form which creates a non-ActiveRecord
model for contact forms but it behaves like a model as far as Rails is
concerned so I will put that class in the models folder.
Lib is mostly for your own classes that don't change much. Hence, in
dev mode Theyre not reloaded. Models are. Models can be any classes,
inheriting from anywhere. They're or your business objects