Ask A Question

Notifications

You’re not receiving notifications from this thread.

Creating A Blog Post Model Discussion

Awesome! : )

Reply

Awesome! : )

Reply

Hi Chris, what's the benefit of using Postgres over sqlite3?

Reply

Well done, Chris!

Reply

For future travellers, the sqlite3 database is under /storage now

Reply

Indeed! <2

Reply

Thanks!

Reply

Thanks for sharing

Reply

Thanks Chris!

Reply

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.

Reply

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?

Reply

try using DBeaver if you are not able to set up TablePlus.
https://dbeaver.io/

Reply

What was going wrong?

Reply

Really helpful!
Could you recommend some sqlite viewers though

Reply
Reply

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!

Reply

Lucy, silly question, but have you made sure the DB has been created first?

Reply

Nope - I didn't know to do that though, but will do so in future. Thanks for replying :)

Reply

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.

Reply

Thanks Jared! This really helpful :D

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,400+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.