For a particular object ("MyObject"), I created initial model/view/controller code by first creating a migration file which added a table to the database and then running this:> ruby script/generate model MyObjectMultiple model/view/controller files were created as expected. However, the next migration file version added columns to the original table. After running migrate again, the table was modified but the view files such as _form.rhtml were not. Is there a way to generate this or is manual modification the only way? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jan 23, 1:50 pm, "stan.baptista" <stan.bapti...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> For a particular object ("MyObject"), I created initial > model/view/controller code by first creating a migration file which > added a table to the database and then running this: > > > ruby script/generate model MyObjectMultiple model/view/controller files were created as expected. > > However, the next migration file version added columns to the original > table. After running migrate again, the table was modified but the view > files such as _form.rhtml were not. > > Is there a way to generate this or is manual modification the only way?I guess you originally ran "script/generate scaffold Whatever", which spat out the pages/forms/etc for you? If this is the case, just run scaffold again with the "-f" option. This will force it to overwrite existing files. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> If this is the case, just run scaffold again with the "-f" option. This will force it to overwrite existing files.That did the trick. Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---