# How to create our own class and how to access that

**URL:** <https://www.ruby-forum.com/t/how-to-create-our-own-class-and-how-to-access-that/108516>\
**Category:** Rails\
**Created:** [July 4, 2007, 11:02am UTC](https://www.ruby-forum.com/t/how-to-create-our-own-class-and-how-to-access-that/108516 "2007-07-04T11:02:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unnikrishnanes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/ce73a5/32.png) [@unnikrishnanes](https://www.ruby-forum.com/u/unnikrishnanes)\
**Post date:** [July 4, 2007, 11:02am UTC](https://www.ruby-forum.com/t/how-to-create-our-own-class-and-how-to-access-that/108516/1 "2007-07-04T11:02:44Z")

</div>

Hi

Could any one tell me about how to create our own class , where to put  
it and how to access that class in controller

Thanks in advance

Unnikrishnan

---

<div class="post-metadata">

**Author:** ![unnikrishnanes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/ce73a5/32.png) [@unnikrishnanes](https://www.ruby-forum.com/u/unnikrishnanes)\
**Post date:** [July 4, 2007, 11:06am UTC](https://www.ruby-forum.com/t/how-to-create-our-own-class-and-how-to-access-that/108516/2 "2007-07-04T11:06:38Z")

</div>

For Rails, you can create your own custom classes and put them in lib  
folder. from lib you can automatically access your classes in  
controllers

On Jul 4, 2:02 pm, Unni K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![unnikrishnanes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/ce73a5/32.png) [@unnikrishnanes](https://www.ruby-forum.com/u/unnikrishnanes)\
**Post date:** [July 4, 2007, 11:18am UTC](https://www.ruby-forum.com/t/how-to-create-our-own-class-and-how-to-access-that/108516/3 "2007-07-04T11:18:47Z")

</div>

Thanks for the reply.

How to access the class in Controller.

Could u give one sample.

also , is there any way to encrypt a password in controller, I mean,  
when we submit a form we will get all the values in controller . can we  
hash that value there?

Thanks

Hasham wrote:

> For Rails, you can create your own custom classes and put them in lib  
> folder. from lib you can automatically access your classes in  
> controllers
> 
> On Jul 4, 2:02 pm, Unni K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
