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

Jacob Christiansen
Jacob Christiansen
3,193 Points

Profile name Must be formatted correctly.

after following these steps http://teamtreehouse.com/library/programming/build-a-simple-ruby-on-rails-application/writing-tests/validating-format

Eventhough my test passes, I can't sign up new users as I always get the message "Profile name Must be formatted correctly." (no matter how i format the name.)

4 Answers

Nano Meko
Nano Meko
1,838 Points

try this in your model:

validates :profile_name, format: { with: /^[a-zA-Z0-9_-]+$/, message: "must be formatted correctly." }

Thanks! -- these errors are starting to get really annoying and are wasting a lot of my time >:(

julcap
julcap
16,274 Points

Thanks for the fix. Just wondering if you don't mind, why does this code work but the code as provided in the tutorial does not?

Thanks again!

Version differences. There have been major version releases for just about everything being used (i.e. Rails 4, Ruby 2, Bootstrap 3) and Treehouse has not updated the content.