how to append some action into already available controller?

What's wrong with just creating those files/methods by hand ?

Fred

Frederick Cheung wrote:

how to append some action into already available controller with corresponding views (*.rhtml) .for example

What's wrong with just creating those files/methods by hand ?

Fred

i thing the main advanstage in Rails framework compare than others is very speed and easy implementation.

actually in some situation i want to create more than one public definition(method) in an existing controller .

in my projects there are lots of controllers (more than 300)

for example if i want to create 5 methods with corresponding views in a controller than ,if i do like this (ofcourse below is wrong) than my speed is 5 to 10 times fater than manual creating....

ruby script/generate controller [-append] contro met1 met2 met3 met4 met5

While script/generate controller is a useful starting point (especially when you're not quite sure what the naming conventions are, what files go where etc...) in my experience unless the methods and views were completely empty the bulk of the effort is in writing them and the time spent actually creating the files is rather negligible.

and one thing i ask ,why the rails developers should not add this append capability in controller generator ?

The generators in general tend to create new files rather than edit them. Off the top of my head I'd say that's because it's a lot easier to add things then it is to edit existing things. That said if you can find a way to make this all work nicely then you can always submit a patch.

Fred