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


Michelle Cannito
Michelle Cannito
8,992 Points

Simple_form users profile_name for first_name.

Course: Build a Simple Ruby on Rails Application (treebook)

I'm using Bootstrap and simple_form. When I use rails console and then

user = User.first

it shows that what I input on the sign-up page for my profile name is in the first_name field. The last_name is correct and the profile_name is nil.

I even deleted the user via the console with user.destroy and created another one via the app, being sure to fill in the fields correctly, but I get the same error.

Where should I look to figure out the mismatch between entering data and the field names they match to?

1 Answer

Michelle Cannito
Michelle Cannito
8,992 Points

I just love the Chrome Developer Tools. By using the Inspect Element choice, I saw that my code for the profile name text field, f.text_field, was being assigned :first_name instead of :profile_name. I guess I had copied other text to save time, ha, and forget to change the text, thus resulting in a lot more time. It was a good exercise in debugging. I'm glad it was a simple error and fix, and had nothing to do with different versions of software.