I am new to rails, and don't know how :has many and :belongs to work,
but I really like the idea of being able to say, for example
email.accounts, and I was wonderign what the requirements are. Does this
system work off of foreign keys, or does it work off of a system like
meaning, that it matches the two email fieldnames?
By default, ActiveRecord expects foreign keys to be named <table>_id.
In your example, account would have a field called email_id of type
:integer. You can then use belongs_to and has_many.
I would also suggest you spend some time trawling the web for
tutorials/books. There are many out there and they'll help you
understand how Rails is put together.