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!

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 trial

Ruby ActiveRecord Basics Migrations and Relationships Migrations 2

Bill Columbia
Bill Columbia
2,027 Points

Won't accept answer?

In the last question, we created a table called contacts, with a first_name and last_name string. How could you include both of those fields automatically by using the generator command?

"Bummer! The first argument should be the name of the table."

My answer: rails generate migration CreateContacts first_name:string last_name:string

Not sure what the issue is here. Don't think it was covered in the video, and the docs don't specify any kind of Table as first argument as far as I can tell?


2 Answers

Chris Dziewa
Chris Dziewa
17,781 Points

The answer you are looking for is the following:

rails generate migration contacts first_name:string last_name:string

You are close. The question is looking for a table named contacts not "CreateContacts". Don't worry about capitalizing it either, Rails takes care of that in the backend.