Newbie: Scaffold doesn't pickup DB changes

I’m following along with the depot example in ‘Agile Web D.’
and ran into a problem with Scaffold. I changed the MySQL table
structure to add a few columns directly and also tried the migrate
script to change the database after I got the initial scaffolding to
work. However, I can’t seem to get the new columns to show up and am
stumped as to how I can get this to work.

Any suggestions on what I might try?

Raghu Murthyemail: [email protected]

On Tue, Jul 25, 2006 at 07:45:55PM -0700, Raghu Murthy wrote:

I’m following along with the depot example in ‘Agile Web D.’ and ran into a problem with Scaffold. I changed the MySQL table structure to add a few columns directly and also tried the migrate script to change the database after I got the initial scaffolding to work. However, I can’t seem to get the new columns to show up and am stumped as to how I can get this to work.

If you used $ script/generate scaffold model, it’ll create a set of
static files for the db, once. It won’t detect any changes.

If you’ve changed the db, re-run the scaffold generator.

I’m using the scaffold: product statement in the ActiveRecord. Book says
this is supposed to automatically generate the scaffold - is that not
the case any more?

Raghu Murthyemail: [email protected]

----- Original Message ----
From: Jim C. [email protected]
To: Raghu Murthy [email protected]; [email protected]
Sent: Tuesday, July 25, 2006 10:01:12 PM
Subject: Re: [Rails] newbie: Scaffold doesn’t pickup DB changes

On Tue, Jul 25, 2006 at 07:45:55PM -0700, Raghu Murthy wrote:

I’m following along with the depot example in ‘Agile Web D.’ and ran into a problem with Scaffold. I changed the MySQL table structure to add a few columns directly and also tried the migrate script to change the database after I got the initial scaffolding to work. However, I can’t seem to get the new columns to show up and am stumped as to how I can get this to work.

If you used $ script/generate scaffold model, it’ll create a set of
static files for the db, once. It won’t detect any changes.

If you’ve changed the db, re-run the scaffold generator.

No, I just used the scaffold: product line in the ActiveRecord as
suggested by the book. Do I still need to run the script to generate a
model?

Thanks,

Raghu Murthyemail: [email protected]

----- Original Message ----
From: Jim C. [email protected]
To: Raghu Murthy [email protected]; [email protected]
Sent: Tuesday, July 25, 2006 10:01:12 PM
Subject: Re: [Rails] newbie: Scaffold doesn’t pickup DB changes

On Tue, Jul 25, 2006 at 07:45:55PM -0700, Raghu Murthy wrote:

I’m following along with the depot example in ‘Agile Web D.’ and ran into a problem with Scaffold. I changed the MySQL table structure to add a few columns directly and also tried the migrate script to change the database after I got the initial scaffolding to work. However, I can’t seem to get the new columns to show up and am stumped as to how I can get this to work.

If you used $ script/generate scaffold model, it’ll create a set of
static files for the db, once. It won’t detect any changes.

If you’ve changed the db, re-run the scaffold generator.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs