Plain old Ruby object location in Rails

ruby, ruby-on-rails, ruby-on-rails-3

Solution

Several choices, but the `lib` directory is the most common.

If you need to initialize the code, the most common place is `config/initializers`.

So you might have:

lib/mystuff.rb

and:

config/initializers/mystuff.rb
lib/mystuff.rb

contains your ruby code.

config/initializers/mystuff.rb

contains code that initializes your stuff, whatever Ruby files that are found in `config/initializers` are run when Rails boots up.

Problem

Rails n00b question. I am creating a plain old Ruby object in Rails. But I am not sure if there is a standard location in the app that I should put this object. Thanks

Original source