Regenerating Views for a Existing Model from Scaffold

Let's say you generated a new model in Rails using the Scaffolding generator. It creates the migration, controller, views, specs and helpers as you expect. A little later, after a bit of coding, on you discover there was a type-o in your command to generate it. Unfortunately and to your own, you didn't follow a few basic best practices by committing your code prior to the generator and immediately after so the fix might be an easy delta change of a few lines. It would be nice to regenerate all of it but we already started working on the controller and the model that was generated as well as some supporting files unrelated to the scaffolded model and we really don't want to lose our current progress. That's okay, this happens to the best of us. The incorrect field, in this case, our seo_description field resulted in some bad output on the generated migration, controller, views and specs. 

It would be nice if there was a cheat sheet to all of this! Take a look here for a rails scaffold cheat sheet of examples.


Home Office

Cherry Hill, NJ

North New Jersey Office

Hasbrouck Heights, NJ

Philadelphia Office

Media, PA

office Hours

Mon - Fri : 8am to 6pm

Social Media