# Newbie Q: How to creat 2 classes

**URL:** <https://www.ruby-forum.com/t/newbie-q-how-to-creat-2-classes/99568>\
**Category:** Rails\
**Created:** [July 24, 2006, 5:25am UTC](https://www.ruby-forum.com/t/newbie-q-how-to-creat-2-classes/99568 "2006-07-24T05:25:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam\_willson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@adam\_willson](https://www.ruby-forum.com/u/adam_willson)\
**Post date:** [July 24, 2006, 5:25am UTC](https://www.ruby-forum.com/t/newbie-q-how-to-creat-2-classes/99568/1 "2006-07-24T05:25:58Z")

</div>

Hi,

I am very new and still learning and I am not sure how to start  
this…could someone show me some code or give some hints…I want to  
creat to classes so there will be admin users and regular users in a  
login system.

Thanks in advance…  
adam

---

<div class="post-metadata">

**Author:** ![adam\_willson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@adam\_willson](https://www.ruby-forum.com/u/adam_willson)\
**Post date:** [July 24, 2006, 6:52pm UTC](https://www.ruby-forum.com/t/newbie-q-how-to-creat-2-classes/99568/2 "2006-07-24T18:52:40Z")

</div>

Any Help???

---

<div class="post-metadata">

**Author:** ![adam\_willson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@adam\_willson](https://www.ruby-forum.com/u/adam_willson)\
**Post date:** [July 24, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/newbie-q-how-to-creat-2-classes/99568/3 "2006-07-24T19:20:51Z")

</div>

adam willson wrote:

> Hi,
> 
> I am very new and still learning and I am not sure how to start  
> this…could someone show me some code or give some hints…I want to  
> creat to classes so there will be admin users and regular users in a  
> login system.
> 
> Thanks in advance…  
> adam

What I would do is just create one table in your database called Users,  
and have one of the fields in the Users table be something like  
“user\_status”. Then you could set the user status for each user to  
either regular or admin. After you create the table in your database  
you can create a class for it by running the following command in the  
command line:

script/generate model Users

You may want to take a look at this tutorial:

> **[Radar - O’Reilly](https://www.oreilly.com/radar/)**
>
> Now, next, and beyond: Tracking need-to-know trends at the intersection of business and technology

---

<div class="post-metadata">

**Author:** ![adam\_willson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@adam\_willson](https://www.ruby-forum.com/u/adam_willson)\
**Post date:** [July 24, 2006, 8:38pm UTC](https://www.ruby-forum.com/t/newbie-q-how-to-creat-2-classes/99568/4 "2006-07-24T20:38:27Z")

</div>

adam willson wrote:

> Hi,
> 
> I am very new and still learning and I am not sure how to start  
> this…could someone show me some code or give some hints…I want to  
> creat to classes so there will be admin users and regular users in a  
> login system.
> 
> Thanks in advance…  
> adam

Adam, I would recommend you install the Engines plugin, and then install  
and configure the LoginEngine engine to your application and review the  
code contained therein. It might actually be just what you need (and  
then some), but if not it will at least give you great insight. I  
learned a ton by just reading the LoginEngine code and following what it  
was doing.

c.

[http://rails-engines.org/](http://rails-engines.org/)
