Generators

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Saturday, 28 July 2007

with ruby on rails, it’s so easy to build stuff fast; heck it’s the nature of being Agile.

script/generate controller [name] [model]
p. …create a controller

script/generate model [name]
p. …create data model

script/generate scaffold [model] [controller]
p. … create ruby scaffold /add/edit/view/list/ using a specific model

script/generate migration add_stuff
p. …create new migration script

rake db:migrate
p. …apply any pending migrations to your database