Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Dave Faliskie
Dave Faliskie
17,781 Points

problem with "date" attribute in data tables

I Have a form that is asking for a persons birthday, under my database I am using the t.date = "birthday". and my form everything displays properly. however when I input the date and hit submit the date is not saved in the database. is there something else that needs to be done in order to store a date into a data table? all my strings are being saved fine, so does anyone know why a date wouldn't work?

thanks, Dave

Kang-Kyu Lee
Kang-Kyu Lee
52,045 Points

Can we see your migration file has that birthday column?

2 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,440 Points

It seems like you're not allowing this parameter in mass assignments. Are you using Rails 3 or Rails 4?

Dave Faliskie
Dave Faliskie
17,781 Points

Thanks for posting back, I dropped my db and then migrated it again, now it works