user108031
user108031

Reputation: 35

Rails Newby: Where should plain old Ruby classes reside?

Where is the best location to put a plain old Ruby class in a Rails application? I'm not sure if it should go in the helper, model, or controller folder or should I create another folder to handle Ruby classes.

Upvotes: 0

Views: 550

Answers (3)

Tony Heupel
Tony Heupel

Reputation: 1053

The question really is, what purpose does it serve? Is it data-like stuff? model for that. Is it a helper class that adds functionality to other classes or is a utility? Probably lib. Etc...

Upvotes: 1

jdl
jdl

Reputation: 17790

It would help to know what your class is trying to accomplish, but in general /lib is a decent enough location.

Upvotes: 0

geofflane
geofflane

Reputation: 2691

In the /lib folder is fine.

Upvotes: 5

Related Questions