Gemfile
, which you'll find in the root folder of your app:model
is replaced with draft:resource
.Note:rails g
is short forrails generate
, likes
forserver
andc
forconsole
.
rails db:migrate
to execute the instructions that the generator wrote for us to create the new table.
If you generated something mistaken:
If you alreadyrails db:migrate
d, then firstrails db:rollback
to undo just the most recent migration. If you didn'trails db:migrate
after you generated the resource, then no need to do this step.
Next,rails destroy draft:resource photowill remove all the files that it previously added. You can then re-generate from scratch.
application.html.erb
-- say yes if you are sure that's okay. Copy out any important stuff if necessary, to be re-pasted back in.