# Re-generating views after a migration

**URL:** <https://www.ruby-forum.com/t/re-generating-views-after-a-migration/131086>\
**Category:** Rails\
**Created:** [March 5, 2008, 10:16pm UTC](https://www.ruby-forum.com/t/re-generating-views-after-a-migration/131086 "2008-03-05T22:16:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@gilles](https://www.ruby-forum.com/u/gilles)\
**Post date:** [March 5, 2008, 10:16pm UTC](https://www.ruby-forum.com/t/re-generating-views-after-a-migration/131086/1 "2008-03-05T22:16:01Z")

</div>

Hi,

I’m new to Rails and I’m trying to get going with Rails 2.0. How can I  
regenerate the views after I make a change to my db schema and run  
db:migrate? Everything works for the sql tables but it seems I have to  
manually update the views files. Any idea?

Thanks  
Gilles

---

<div class="post-metadata">

**Author:** ![gilles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@gilles](https://www.ruby-forum.com/u/gilles)\
**Post date:** [March 5, 2008, 10:51pm UTC](https://www.ruby-forum.com/t/re-generating-views-after-a-migration/131086/2 "2008-03-05T22:51:03Z")

</div>

If you’re talking about the scaffold, you can use the same command you  
used the first time. it will ask you what files you want to overwrite.

---

<div class="post-metadata">

**Author:** ![gilles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@gilles](https://www.ruby-forum.com/u/gilles)\
**Post date:** [March 5, 2008, 11:08pm UTC](https://www.ruby-forum.com/t/re-generating-views-after-a-migration/131086/3 "2008-03-05T23:08:41Z")

</div>

This is true, but note that you have to list off all the fields &  
datatypes when you issue the generate scaffold command, or else you’ll  
get a bunch of mostly empty templates.

AFAICT, you are intended to manually edit the view files.

HTH,

-Roy

---

<div class="post-metadata">

**Author:** ![gilles](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@gilles](https://www.ruby-forum.com/u/gilles)\
**Post date:** [March 6, 2008, 8:30am UTC](https://www.ruby-forum.com/t/re-generating-views-after-a-migration/131086/4 "2008-03-06T08:30:35Z")

</div>

Thanks!
