I have a User model, where users have a username, and User has_one :profile
I want to make a route so that if a person goes to "http://www.website.com/username" it goes to profile#show.
at the bottom of my routes, i have:
match ":username" => "profiles#show"
But, it's not finding the ID of the profile, which I expected.
ActiveRecord::RecordNotFound in ProfilesController#show
Couldn't find Profile without an ID
I just am not sure how to properly make the route so i get the id of the user from the :username
thanks