Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top