rollback generated controller/model in RoR rollback generated controller/model in RoR ruby-on-rails ruby-on-rails

rollback generated controller/model in RoR


try

rails destroy scaffold XXXXX

one thing that I find puzzling though is that you said "Later I discovered it would be a good idea to create the tables in the DB first..."

Well, rails creates a migration file for you when you run the generator in the first place, and this file will create your DB tables and fields when you run it using rake db:migrate

PS - here's a few good tutorials for you:


You can rollback controller.

rails destroy controller [controller]


You can delete all the files Rails created -- just look at the printout on your command line, see what files rails created, and delete them.

I don't know why you would want to create all the tables in the db, but that's fine, I guess. I prefer to let rails do it. Either way, Rails won't mind. You can always add / change fields using Rails, even if you created the tables outside Rails.

Ryan Bates' Railscasts are excellent tutorials.