View/_form.rhtml help, joining multiple tables, one form

I am not sure how to build a view/people/_form.rhtml that needs to pull
data from multiple tables. The “magic” for Rails makes it a little
strange.

I am new at this, and any examples you can through my way, or actual
code, would be greatly appreciated.

Here are some simplified tables that I am using:

Table 1:

table name: people
columns: id, fname, lname, email

example data:
1, bob, smith, [email protected]
2, julie, smith, [email protected]

Table 2:

table name: interests
columns: id, name

example data:
1, Soccer
2, Tennis
3, Football

Table 3:

table name: people_interests
columns: id_person, id_interest

example data:
1, 1
1, 3
2, 1

that would tell you that:
Bob is interested in Soccer and Football
Julie is interested in only Soccer

So I want to create a form that will have these fields:
First Name: __________
Last Name: __________
Email: __________

What are your interests?

Checkbox - Soccer
Checkbox - Tennis
Checkbox - Football


I am assuming that my view/_form.rhtml would look something like this:

First Name
<%= text_field 'person', 'fname' %>

Last Name
<%= text_field 'person', 'lname' %>

Email
<%= text_field 'person', 'email' %>

<% for interest in @interests %>

<%= check_box('interest', 'id') %>

<% end %>

But I am not sure how to “link” it all together. In PHP I would get
$_POST[‘fname’], etc and put that in the table, then grab the posted
check boxes and put those id #'s in the people_interests table.