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

David Warren
David Warren
1,803 Points

Trouble with attr_accessible

I'm just beginning to learn ruby, and I've been following the videos. I just finished the creating relationships video, and I've run into trouble. The attr_accessible functions seems to have been taken out of the bootstrap, and so I'm getting an error. I've been getting the undefined method 'first_name' for nilclass. Any ideas?

1 Answer

Brandon Harvey
Brandon Harvey
5,709 Points

make sure you are reading the user guide notes, they are using bootstrap version 2 in the video.... theres a bootstrap 3 out now. Some of the coding is a little different.

David Warren
David Warren
1,803 Points

Hey, ok. Thanks, you're the first person to help me. Where are the user guide notes?

.... Edit: Nevermind, I found them. However, I don't think my problem is in bootstrap.

Kyle Daugherty
Kyle Daugherty
16,441 Points

This isn't a result of bootstrap or attr_accessible. It sounds like you don't have a user associated with one or more of the statuses you created. You need to delete those statuses without an associated user or add a user ID to them. Take a look at the show notes around the time of 5:38 where Jim discusses this error.