Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTeddy Stanowski
6,113 PointsI honestly do not know how to answer this question or I am missing something entirely...
How am I to generate another model migration of the table I already created? Or worse when I try to migrate the table it says I am not using the correct table name? It's called CreateContacts.. I am lost on this.
rails generate migration model CreateContacts
1 Answer
Steve Hunter
57,712 PointsHi Teddy,
It is asking how you'd add the columns to the table at the same time as creating the table. So, in a single command, create a table called contacts
with columns called first_name
and last_name
both of which are strings.
That looks like:
rails generate migration contacts first_name:string last_name:string
I hope that helps,
Steve.