# Where do you put Classes in RoR

**URL:** <https://www.ruby-forum.com/t/where-do-you-put-classes-in-ror/56935>\
**Category:** Rails\
**Created:** [April 5, 2006, 11:08pm UTC](https://www.ruby-forum.com/t/where-do-you-put-classes-in-ror/56935 "2006-04-05T23:08:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Shawn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/45deac/32.png) [@Tony\_Shawn](https://www.ruby-forum.com/u/Tony_Shawn)\
**Post date:** [April 5, 2006, 11:08pm UTC](https://www.ruby-forum.com/t/where-do-you-put-classes-in-ror/56935/1 "2006-04-05T23:08:14Z")

</div>

I’m just trying RoR and it works very smoothly. I’am also somewhat  
familiar with ruby however I do not know where my Classes are supposed  
to go in RoR.

E.g. my ruby file looks like

include a\_few\_lib\_here

Class function\_name  
def aaaa  
end  
end

#main program  
yadayada = function\_name(parameter)

I understand:

- the main program goes in a controller I have to create
- but where am I suppose to put the Class stuff?

I’ll re-use the Class stuff for different controllers but I’m not sure  
where it is suppposed to go. Thanks.

-T

---

<div class="post-metadata">

**Author:** ![Tony\_Shawn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/45deac/32.png) [@Tony\_Shawn](https://www.ruby-forum.com/u/Tony_Shawn)\
**Post date:** [April 6, 2006, 12:32am UTC](https://www.ruby-forum.com/t/where-do-you-put-classes-in-ror/56935/2 "2006-04-06T00:32:26Z")

</div>

The “lib” directory is probably what you need; and don’t forget to  
require your lib in environment.
