I''m following along with the depot example in ''Agile Web Development'' 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: raghuk@yahoo.com
On Tue, Jul 25, 2006 at 07:45:55PM -0700, Raghu Murthy wrote:> I''m following along with the depot example in ''Agile Web Development'' 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: raghuk@yahoo.com ----- Original Message ---- From: Jim Cheetham <jim@gonzul.net> To: Raghu Murthy <raghuk@yahoo.com>; rails@lists.rubyonrails.org 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 Development'' 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: raghuk@yahoo.com ----- Original Message ---- From: Jim Cheetham <jim@gonzul.net> To: Raghu Murthy <raghuk@yahoo.com>; rails@lists.rubyonrails.org 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 Development'' 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.