I”m building a Rails app, and there are two models that I want to connect.
There’s a model called “users” that handles user authentication, e.g. username and password data. Then there’s a model called “profiles” that has a person’s location, description, etc, etc.
I want to link the models so that there’s one profile per user. I really don’t know how to do this. Anyone mind sharing some insight on how this can be done?
take a look at rails associations basics
your asociation will look like
oh, the table profiles must have a user_id column with the foreign key to the user.