NoMethodError

Have you run all your migrations? Do you have the price column in your itemdetails table?

Leonardo Mateo wrote:

follows: http://pastie.org/private/wvqtorzl12vrkrudzc8ha

Have you run all your migrations? Do you have the price column in your itemdetails table?

-- Leonardo Mateo. There's no place like ~

Thanks Leonardo.

I have included "price" when generating the scaffold. When I checked the "itemdetails" table using SQLite Manager, the price in addition to other fields are not presented as columns, but, there is ONE column presented :expressionless:

You can even see the fields presented in the show.html.erb og itemdetail attached.

I also made a rake db:migrate

Why aren't those fields present in the table?

What do you think I should do now?

Thanks.

Does sequence have to do here?

I mean, if I create the scaffold "item", must I IMMEDIATELY rake db:migrate BEFORE creating the scaffold "itemdetails"?

In my tables, I can see that the "items" table has the required fields, but "itemdetails". You know the story :slight_smile:

Thanks.

Leonardo Mateo wrote:

follows: http://pastie.org/private/wvqtorzl12vrkrudzc8ha

Have you run all your migrations? Do you have the price column in your itemdetails table?

-- Leonardo Mateo. There's no place like ~

Thanks Leonardo.

I have included "price" when generating the scaffold. When I checked the "itemdetails" table using SQLite Manager, the price in addition to other fields are not presented as columns, but, there is ONE column presented :expressionless:

You can even see the fields presented in the show.html.erb og itemdetail attached.

I also made a rake db:migrate

Why aren't those fields present in the table?

Maybe there was something wrong with your migration generated file

What do you think I should do now?

Check the migration file created for the itemdetails scaffold, fix it and re-do that migration with rake db:migrate:redo VERSION=YOUR_MIGRATION_VERSION_NUMBER_HERE

If you want to start fresh, just re-create the scaffold and make sure all the fields are created properly. You can also generate a new migration to add the missing fields to this table, but I wouldn't recommend this for clarity sake.

Hope it helps.

Does sequence have to do here?

I mean, if I create the scaffold "item", must I IMMEDIATELY rake db:migrate BEFORE creating the scaffold "itemdetails"?

No, no need to.

Thanks Leonardo. Just a small question since I'm nearly new to Rails. What is the "migration file" called?

There you go. Sorry for the late. To find the migration files you should look at the db/migrate directory, there you'll find those files named with the version number (which is actually a timestamp) , followed by a relevant name about what they do. For example, your itemdetails scaffold migration file, might be named something like this: 20100717192542_create_itemdetails.rb

Hope it helps.

Cheers.