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

Attachments aren't displaying on the status (:user_id is nil?)

I've been trying to figure this out on my own, but I think I need another brain to think this through with me. For some reason my attachments aren't displaying. They are attaching just fine (since I can find them in my public folder), but from what I can tell they are not connecting to the user properly.

I opened up the rails console and looked at the information associated with the documents as well as the statuses and I noticed that the ":user_id" for the document is nil. I also noticed that the ":document_id" for the status is nil. I thought this was related to something wrong with my db, checked the schema, noticed the add_index "documents", ["user_id"] wasn't in there even though I did that in the migration file. I reset the db and it finally showed up, but it didn't fix my problem.

Any other thoughts as to why this may not be working? I've checked and re-checked my text for typos, but I don't see any, so maybe I just need another set of eyes. Please and thank you!

2 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hey Evan Young can you post a link to your code up on GitHub so we can take a look?