Hello, i am new to Ruby. question: i used scaffold to create a Database migration with lets say 2 fields: name:string surname:string The scaffolding and migrationprocess has done the DB and the view edit delete action. I want to add a new database field. I can do this in the migrationfile and the schema file and do the db migration again but the scaffolding part is not done again. Is there a way to do this automatically? Otherways i allways have to delete the Database and do all the scaffolding again and my changes made to the views are lost. Any idea? tia -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You''ll want to create a new migration: ruby script/generate migration <migration_name> then edit the migration to add the field (descriptive migration naming will help you later) run the migration and add that field to the index/edit/new views... no need to redo the database in total. A Rails app is built of many migrations, which most see as a normal part of refactoring as new features or capabilities are added over time. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, so i have to add the new fields by hand to the view manually. The database thing is running fine. My question was about the manual changing the view/index/edit-files. So there is no way to do this automatically? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---