bbatsov/rails-style-guide — Issue #10: Other Classes and Modules
Author: gerggggggg
Created: 2011-10-21 22:15:46+00:00
State: open

The thing I have the most trouble with trying to figure out how to do it "the rails way" is where to put a custom Class or some utility methods that aren't helpers and don't belong in a model or controller.

The best example I can offer off the top of my head is a rather complex rake task that makes sense to implement in its own class or module. I currently place these classes in the util folder, but is that the best location? Furthermore, how should I structure the directories in this folder? Should I use a java like package hierarchy like util/com/foo/bar/MyClass?

In general, what's the recommended practice for code that's not a model, view, controller, or helper?