views:

101

answers:

1

A single Rails command can make lots of changes in an app - creating files and migrations, adding routes, etc. Undoing the damage of a mistake could be tricky for a beginner.

For example, say you generate some scaffolding, run the migration, and then realize your scaffolding command should have been singular (ruby script/generate scaffold cake type:string) instead of plural (ruby script/generate scaffold cakes type:string).

If you destroy the scaffolding before rolling back the database migration, you've created another problem.

So: what steps do you take to undo mistakes in Rails development?

+6  A: 

Always, always put your Rails application under version control. It doesn't really matter if you want to use Git, Mercurial or SVN... regardless your choice, don't start a Rails project without a Version Control System.

A SCM tool is your global UNDO button.

Simone Carletti