This is probably quite a simple problem for someone (but not for me!),
what is the best way to solve the following?
I have 3 tables: users, friends and names. The table formats are (I have
cut out the irrelevant parts to simplify):
(friend_identity is a pseudo for the user_id of the friend)
I have the following relations (again only the relevant parts):
class Friend < ActiveRecord::Base
class User < ActiveRecord::Base
class Name < ActiveRecord::Base
What I would like to do is for all records corresponding to a specific
user_id in the friends table, generate a dropdown menu in the view with
the firstname and the lastname of the user “friend_identity” and have
the value equal to their user_id.
I am guessing that this can be done somehow by relating the name and
friend tables in RoR (maybe with a foreign_key??). Is there a simple way
to do this, Unfortunately, I always end up with a mess of code when I
Any help would be really appreciated.