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 trialMichael Ballentine
9,932 PointsDeleting all users and statuses
what are the commands to delete all users and statuses from my databases, I feel like this is what is giving me some issues with using
<%= @status.user.full_name %>
It's saying there's no method for 'full_name', but there certainly is
2 Answers
Brandon Barrette
20,485 PointsIn the rails console, you can run:
Status.delete_all
That will delete all statuses from the database.
Likewise,
User.delete_all
Will delete all the users.
Tony McKeown
Courses Plus Student 14,300 PointsIf you want to delete the whole database I think (off the top of my head) you could enter rake db:reset
This link seems to discuss various commands on your database.
Michael Ballentine
9,932 PointsThank you.. just to be sure, the database/db is what's holding user accounts, statuses, and everything else right?
Michael Ballentine
9,932 PointsMichael Ballentine
9,932 PointsThank you, this is what I needed.. I don't know what's going on but something doesn't have a value so it's throwing the whole database..hopefully this will solve it
Michael Ballentine
9,932 PointsMichael Ballentine
9,932 PointsYeah, deleting all Statuses and Users using the console fixed the problem