# How do I overwrite/extend a scaffold module?

**URL:** <https://www.ruby-forum.com/t/how-do-i-overwrite-extend-a-scaffold-module/98971>\
**Category:** Rails\
**Created:** [July 19, 2006, 1:14pm UTC](https://www.ruby-forum.com/t/how-do-i-overwrite-extend-a-scaffold-module/98971 "2006-07-19T13:14:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldk2005](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@ldk2005](https://www.ruby-forum.com/u/ldk2005)\
**Post date:** [July 19, 2006, 1:14pm UTC](https://www.ruby-forum.com/t/how-do-i-overwrite-extend-a-scaffold-module/98971/1 "2006-07-19T13:14:22Z")

</div>

I have many pages to generate quickly. They are based off of the  
scaffold  
generator, but I want to convert the rhtml files to Markaby, and change  
some  
formatting. Without having to do a lot of repetitive hand editing. Is  
there  
a simple way to overwrite/extend part of the scaffold generator? Do I  
need  
to write my own from scratch?

---

<div class="post-metadata">

**Author:** ![ldk2005](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@ldk2005](https://www.ruby-forum.com/u/ldk2005)\
**Post date:** [July 19, 2006, 2:11pm UTC](https://www.ruby-forum.com/t/how-do-i-overwrite-extend-a-scaffold-module/98971/2 "2006-07-19T14:11:00Z")

</div>

Larry K. wrote:

> I have many pages to generate quickly. They are based off of the  
> scaffold  
> generator, but I want to convert the rhtml files to Markaby, and change  
> some  
> formatting. Without having to do a lot of repetitive hand editing. Is  
> there  
> a simple way to overwrite/extend part of the scaffold generator? Do I  
> need  
> to write my own from scratch?

I’m not quite sure about what you need here and not sure what Markaby is  
but if it’s on a linux box and all you need is to rename the files  
(don’t know if you can change the contents of the file) from .rhtml to  
.mab, a Linux command on renaming is:

mv \*.rhtml \*.mab

And all of your files will be get renamed to the following extension.

hope that was helpful

Bing

---

<div class="post-metadata">

**Author:** ![ldk2005](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@ldk2005](https://www.ruby-forum.com/u/ldk2005)\
**Post date:** [July 19, 2006, 2:24pm UTC](https://www.ruby-forum.com/t/how-do-i-overwrite-extend-a-scaffold-module/98971/3 "2006-07-19T14:24:14Z")

</div>

Thanks for the reply. What I was trying to say was that I needed to  
re-write parts of the default scaffold generated code. For instance,  
adding  
css class names to the labels on the forms. Converting the default  
\_form.rhtml to a more CSS friendly fieldset layout. Overwrite was a  
bad  
choice of words. I think the OO term is ‘overloading’. Where you change  
the  
behavior of a method by creating a new one with the same name.  
-Larry

---

<div class="post-metadata">

**Author:** ![ldk2005](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@ldk2005](https://www.ruby-forum.com/u/ldk2005)\
**Post date:** [July 20, 2006, 4:17pm UTC](https://www.ruby-forum.com/t/how-do-i-overwrite-extend-a-scaffold-module/98971/4 "2006-07-20T16:17:40Z")

</div>

Is it possible to override the scaffold output for the ‘\_form.rhtml’  
file?

if not, should I be looking at creatin a generator or a plugin to  
build my  
own custom replacement?  
-Larry

---

<div class="post-metadata">

**Author:** ![ldk2005](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@ldk2005](https://www.ruby-forum.com/u/ldk2005)\
**Post date:** [July 19, 2006, 3:22pm UTC](https://www.ruby-forum.com/t/how-do-i-overwrite-extend-a-scaffold-module/98971/5 "2006-07-19T15:22:41Z")

</div>

Larry K. wrote:

> Thanks for the reply. What I was trying to say was that I needed to  
> re-write parts of the default scaffold generated code. For instance,  
> adding  
> css class names to the labels on the forms. Converting the default  
> \_form.rhtml to a more CSS friendly fieldset layout. Overwrite was a  
> bad  
> choice of words. I think the OO term is ‘overloading’. Where you change  
> the  
> behavior of a method by creating a new one with the same name.  
> -Larry

I think that’s a real good question, because in the default rendering  
are alway things missing … and sometime real basic stuff. I tried out  
ruby-on-rails and wondered that the date an time formats are shown nice  
with lists, but enumeration an sets not. A enumeration in mysql should  
generate radio-button or a list, a set check-boxes for example and not a  
plain input field.

For me is the question …

1. where can submit some kind of feature requests and
2. how could I overload (=adding features, not rewrite all by myself)  
the default scaffolding.

Chris.
