Creating A Blog Post Model Discussion
Having issues, unfortunately. keep rewatching the first couple of videos over and over to see where I went wrong but Rails generate, doesn't return the list of options.
Disregard the above comment, I realized what was going on and corrected everything.
One thing I can't get to work, is setting up TablePlus.
Does anyone have any good resources to assist?
Hey! I am VERY new to Ruby and Rails and was struggling with the rails db:migrate not creating the columns correctly but from another tutorial it said to use 'bundle exec rails db:migrate' so I tried on the models here and it worked! Not sure why but in case anyone else is struggling or confused, could give this command a try when migrating to db!
Lucy, silly question, but have you made sure the DB has been created first?
PostgreSQL users: if you're having trouble with the db:migration for the model you need to create the database first. So before you've created the model (rails generate model BlogPost title:string body:text) you need to create the database. From the terminal, make sure you're in the right directory (~/blog) and type " rake db:create " without the quotes. This should create two databases: blog_development and blog_test. Once created, you can create your model as Chris shows and then run db:migrate to move it to the development database.