Forum: Ruby on Rails Database and model folder

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
23157aad31883016f0facbb7bff5e3aa?d=identicon&s=25 Shalini Sah (Guest)
on 2012-05-31 14:43
(Received via mailing list)
Hi,

I have a database with multiple tables. How do I directly pick the
information from the database and populate my model folder with
classes instead of doing it manually? Can some one direct me to the
specific set of commands for this.

Thanks & Regards,
Shalini
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2012-05-31 14:58
(Received via mailing list)
On 30 May 2012 10:51, Shalini Sah <shalinisah6692@gmail.com> wrote:
> Hi,
>
> I have a database with multiple tables. How do I directly pick the
> information from the database and populate my model folder with
> classes instead of doing it manually? Can some one direct me to the
> specific set of commands for this.

There may be a way of doing this but I do not know it.  Note though
that it is easy to do by hand.  For each table (table widgets for
example) make a file widget.rb and in there put

class Widget < ActiveRecord::Base
end

Colin
This topic is locked and can not be replied to.