How do I overwrite/extend a scaffold module?

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?

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

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

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

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs