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!
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

David Solow
7,542 PointsTreeBook database is not storing first_name or last_name
It looks like my TreeBook app is functioning correctly for the most part; however, whenever I signup a user, the entries for first_name and last_name do not get saved. So, whenever I try to view a status from that user, an error comes up because the app cannot find a name to display in the database. Anyone have any thoughts?
For reference, I'm up to Build a Simple Ruby on Rails Application > Customizing Forms > Creating Relationships

Seth Duncan
10,339 PointsI'm not sure if this is secure, so if someone more experienced with Ruby/RoR sees an issue by all means let me know, but this was based off the documentation for devise, found here

Marek Dano
6,419 PointsThanks, it works for me. I'm using Rails 4 with Ruby 2.0. I'm also not not sure if this approach is secure.
1 Answer

Richard Crawford-Wilson
6,094 PointsDid you migrate the database? rake db:migrate
with the migration that adds those columns to the database?

David Solow
7,542 PointsYes - I tried migrating the database again, but no luck.

Richard Crawford-Wilson
6,094 PointsThen you need to show us code.
go to gist.github.com and post the following files:
Your database Migration that was generated. located in db/migrate/ The statuses controller The status model and your _form.html.erb and new.html.erb views
Note you can post multiple files in one gist on that site, dont make more than one gist.

David Solow
7,542 PointsHere is the gist with my code: https://gist.github.com/davesolow/6215467
Thank you for the help!

Richard Crawford-Wilson
6,094 PointsWhat version of rails are you using? type: rails -v
in console and tell me what you're using.

David Solow
7,542 Points4.0.0.rc2

Richard Crawford-Wilson
6,094 PointsYou need to use Rails 3.2.14. There is a VERY large difference between 3.2.x and 4.x. The videos were made using 3.2.x. I'd suggest downloading the project files or restarting the project from scratch making sure that rails version in your gemfile is set to 3.2.14.

David Solow
7,542 PointsGot it - I'm working off the project files now and everything is going much smoother. Thanks for the help Richard!
Seth Duncan
10,339 PointsSeth Duncan
10,339 PointsJust so it's available to other users that will come across this if they are using Rails 4.0.0rc2+
I had the same issue and after reading up on devise documentation I found to solve your issue you can place the following in your Application Controller, it tells the devise controller to accept these parameters as permitted parameters: