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.


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 >:(

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.