Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Generate a Scaffold

alejandro macias
alejandro macias
839 Points

how can you edit text on "generate scaffold"

If i forgot to type out some of the text on the "generate scaffold portion" then when I go and try to retype it to include all the text on the instructions I get this message. "Use --force to replace this migration or --skip to ignore conflicted file."

3 Answers

James Walsh
James Walsh
2,158 Points

If you have just barely run the scaffold command and aren't dealing with any real data yet, I would recommend just re-doing the scaffold and the schema completely. It's a bit trickier if you are actually working with a particular schema and don't want to lose data. However, if the first situation is the case, I would just run "rails destroy scaffold my_model" and then run "rails generate scaffold my_model" and then put in the correct schema.

Matthew Thompson
Matthew Thompson
4,500 Points

Hi, these command worked for me but I also needed to run a 'bin/rake db:migrate' after the the destroy command as I had added a new column into the schema by mistake. Once I did this I ran the 'rails generate todo_list...' command and the the db:migrate command and it worked again.

Hope this helps someone else.

Matt

Nano Meko
Nano Meko
1,838 Points

you can also undo a scaffold using the command:

rails destroy scaffold my_model