3

I used generate scaffold to setup the basic RESTful actions however I want to extend the actions to include something like 'purchase'. Is there a way to use the command line to generate the boilerplate (stub functions in controller file and updated route file?)?

As far as I can tell generate controller either wipes or leaves the existing file - there's no nice way to merge them.

tshepang
  • 12,111
  • 21
  • 91
  • 136
bias
  • 1,467
  • 3
  • 19
  • 39

1 Answers1

5

Not by default. However, realize that in Rails 3, customizing generators isn't terribly difficult. See Creating and Customizing Rails Generators & Templates, and Bates' screencast on Generators in Rails 3.

Regarding your second "question," that's right -- the file is either replaced or overwritten.

ybakos
  • 8,152
  • 7
  • 46
  • 74