patternrubyrailsCritical
Undo scaffolding in Rails
Viewed 0 times
scaffoldingrailsundo
Problem
Is there any way to 'undo' the effects of a scaffold command in Rails?
Solution
First, if you have already run the migrations generated by the
You can create scaffolding using:
(or similar), and you can destroy/undo it using
That will delete all the files created by
scaffold command, you have to perform a rollback first.rake db:rollbackYou can create scaffolding using:
rails generate scaffold MyFoo(or similar), and you can destroy/undo it using
rails destroy scaffold MyFooThat will delete all the files created by
generate, but not any additional changes you may have made manually.Code Snippets
rake db:rollbackrails generate scaffold MyFoorails destroy scaffold MyFooContext
Stack Overflow Q#963420, score: 819
Revisions (0)
No revisions yet.