Newbie Q: How to creat 2 classes

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

Any Help???

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:

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/