# Modifying script generated scaffold output Books/Authors

**URL:** <https://www.ruby-forum.com/t/modifying-script-generated-scaffold-output-books-authors/51928>\
**Category:** Rails\
**Created:** [January 9, 2006, 11:16am UTC](https://www.ruby-forum.com/t/modifying-script-generated-scaffold-output-books-authors/51928 "2006-01-09T11:16:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unebaguettesvp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/47e85d/32.png) [@unebaguettesvp](https://www.ruby-forum.com/u/unebaguettesvp)\
**Post date:** [January 9, 2006, 11:16am UTC](https://www.ruby-forum.com/t/modifying-script-generated-scaffold-output-books-authors/51928/1 "2006-01-09T11:16:53Z")

</div>

People,

For my little book library db I find the rails script generated stuff  
fine for most of my needs but there is one thing I couldn’t figure  
out . .

Part of the auto output of app/view/books/edit.rhtml is:

\<%= start\_form\_tag :action =\> ‘update’, :id =\> @book %\>  
\<%= render :partial =\> ‘form’ %\>  
\<%= submit\_tag ‘Edit’ %\>  
\<%= end\_form\_tag %\>

but I need to add in:

**Author** \<% @authors.each do |author| %\> \> \<%= author.last\_name %\> \<%= author.first\_name %\> \<%= author.other\_name %\> \<% end %\>

so I can update the author (in the author’s table) if necessary. If I  
insert this code after the first line above it seems to update the  
author OK (comment: shouldn’t the button say “Update”?) but is there  
some way to position the author label and field on the page  
automatically like the other bookk fields?

Thanks,

## Phil.

Philip R.

Pricom Pty Limited (ACN 003 252 275 ABN 91 003 252 275)  
GPO Box 3411  
Sydney NSW 2001  
Australia  
Mobile: +61:(0)411-185-652  
Fax: +61:(0)2-8221-9599  
E-mail: removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![unebaguettesvp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/47e85d/32.png) [@unebaguettesvp](https://www.ruby-forum.com/u/unebaguettesvp)\
**Post date:** [January 9, 2006, 11:25am UTC](https://www.ruby-forum.com/t/modifying-script-generated-scaffold-output-books-authors/51928/2 "2006-01-09T11:25:56Z")

</div>

> **Author**

[…snip…]

> 

this should go into the \_form.rthml file wich defines the actual  
fields displayed

Also I found, that I always rewrite \_form.rhtml an “hard-code” field  
names etc in order to get the layout I want for my forms.

cu jc
