Skip to content
rubytester edited this page Oct 17, 2013 · 3 revisions

We use code generators to make development of common tasks a little faster. The code is located in the generators directory in your project root but is run using script/generate.

Model-View-Controler Generation

This generator is used to create a strawman Model-View-Controller workflow.

  script/generate mvc WORKFLOW_NAME BASE_CLASS_NAME

So for example,

  script/generate mvc account address

would do the following:

  • create the directory workflows/account
  • create an address_model.rb, address_view.rb and address_controller.rb with the class references set up
  • create a loader.rb to require the above files