# RE: Maintaining DB reflection without scaffolding

**URL:** <https://www.ruby-forum.com/t/re-maintaining-db-reflection-without-scaffolding/82037>\
**Category:** Rails\
**Created:** [December 29, 2005, 11:31pm UTC](https://www.ruby-forum.com/t/re-maintaining-db-reflection-without-scaffolding/82037 "2005-12-29T23:31:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 29, 2005, 11:31pm UTC](https://www.ruby-forum.com/t/re-maintaining-db-reflection-without-scaffolding/82037/1 "2005-12-29T23:31:41Z")

</div>

removed\_email\_address@domain.invalid wrote:

> > I would like to know if there is a way to maintain database  
> > reflection for the ‘new’ and ‘edit’ views whilst removing  
> > scaffolding?
> 
> Check out what Scaffolding does, it’s something like:
> 
> Model.columns.each do |c|
> 
> # print field…
> 
> end

Phillip,

I forgot to mention that the db reflection also goes away when the  
scaffolding is generated to disk. So the only way to have db reflection  
that I’ve found so far is via “dynamic” scaffolding like the following  
in the controller:

```
scaffold :foobar

```

I haven’t been able to find anything like your psuedo-code above in the  
generated scaffolding or the API docs. Where do you say it should  
reside?

Matt

–  
Matt C. Wagner  
Information Security Analyst

Network Intrusion Detection  
Security Operations Center  
Corporate Information Security  
Wells Fargo Bank

This message may contain confidential and/or privileged information. If  
you are not the addressee or authorized to receive this for the  
addressee, you must not use, copy, disclose, or take any action based  
on this message or any information herein. If you received this message  
in error, please advise the sender immediately by reply e-mail and  
delete this message. Thank you for your cooperation.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 31, 2005, 1:13am UTC](https://www.ruby-forum.com/t/re-maintaining-db-reflection-without-scaffolding/82037/2 "2005-12-31T01:13:42Z")

</div>

On 30/12/2005, at 11:30 AM, removed\_email\_address@domain.invalid wrote:

> generated scaffolding or the API docs. Where do you say it should  
> reside?

Yes, the forms are statically generated, but the table listing isn’t.  
Generate scaffolding to disk and look in the table view. The code you  
want will be something like:

\<% for column in Model.content\_columns %\>

**\<%= column.human\_name %\>:**

\<% end %\>

–  
Phillip H.  
removed\_email\_address@domain.invalid
