开发者

Can I re-run a scaffold to update the update/new form?

开发者 https://www.devze.com 2023-02-14 03:14 出处:网络
If I ran scaffold and it created the new/update routes and html forms, and then later I added a few columns to th开发者_开发技巧e database via a migration, is it possible to update the html form that

If I ran scaffold and it created the new/update routes and html forms, and then later I added a few columns to th开发者_开发技巧e database via a migration, is it possible to update the html form that was generated?


Yes u can..and you should do it to update your views.And it will ask some overwrite prompts


Yes you can. You can simply run rails generate scaffold <model> <fields> and add --skip or --force on the end. This will do exactly what it sounds like it will do. It will either override files that all ready exist or skip the files that all ready exist.

0

精彩评论

暂无评论...
验证码 换一张
取 消