I would like to make something like this:
@profiles
#(I think in Java, so I have declared an @profiles variable there! I know it's probably wrong!)
@users.each do |user|
profile = Profile.find(params[user.id])
@profiles.add(profile)
end
The user and profile have a one-to-one relationship.
user has one profile,
profile belongs to user
You need to initialize the array.
If you have a relationship, you should be able to just say: