Topic: Model Generation (Automatic)

I am a newbie to RoR but have experience in CakePhp Framework which is derieved from RoR.
Is it possible to autogenerate the Models from the Database Table along with the Relations between the Tables?
All i see is manual connetion between the Models as well as manual Table Creation.
I am little confused because this was possible in CakePhp.
Thanks .

Re: Model Generation (Automatic)

No, I don't think so. But what do yuo mean under

autogenerate the Models from the Database Table along with the Relations between the Tables

Even after using scaffold generator, your models are just empty AR classes. It's up to you add some business logic inside: relations, validations, etc. That's why it's not possible to autogenerate the stuff like that, - there is lot of constraints.

Re: Model Generation (Automatic)

Thanks Javix.

   In CakePhp Models along with the relations between Tables are autogenerated from command Prompt so i thought same applied to RoR too.
My bad.
Thanks anyway.

Re: Model Generation (Automatic)

In rails to generate a model from the command prompt/terminal you just use

rails g model MyModel

but it is never based on DB schema or smth like this.