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

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.
11bd67aedc131020a51440fad59116cc?d=identicon&s=25 a.filipowski (Guest)
on 2005-11-15 18: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:

http://api.rubyonrails.com/classes/ActiveRecord/Co...
SchemaStatements.html#M000507

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:

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


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

Thanks in advance.

Andrew
52729a33306fb318f9f4f4ec47f6fb17?d=identicon&s=25 erisynne (Guest)
on 2005-11-15 20: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.

http://glu.ttono.us/articles/2005/10/27/the-joy-of...

Amy

--
Ruby on Rails, Design, Writing...
http://www.slash7.com/
This topic is locked and can not be replied to.