Forum: Ruby on Rails Newbie - How Do I Create a new Table

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
a.filipowski (Guest)
on 2005-11-15 19:27
(Received via mailing list)
Ok I have been running around the web for the last couple of hours
and can not for the life of me figure out how to create a new table
using the create_table method found in the docs here:

Basically I have set up a DB as well as a scaffold and made some
changes. When i create a new record i want to also create a new table
that is associated with that record to hold some other data. I have
tried both ways in the api doc from my controller as well as the
model and still can not get it to actually create a table. I receive
various errors telling me the method for create_table can not be
found. The code I am trying to run right now is generic as  I just
want a table created it is:

add_column(:suppliers, :name, :string, {:limit => 60})

Can some one please point me at an example or a tutorial?

Thanks in advance.

erisynne (Guest)
on 2005-11-15 21:49
(Received via mailing list)
Seems like you're using the wrong syntax. Try this article... I think
it'll help demystify the process for you.


Ruby on Rails, Design, Writing...
This topic is locked and can not be replied to.