Newbie question about foreign keys

I have a simple situation. There are two tables:

states
    id int

locators
    state_id int

Obviously, state_id is a foreign key. I have created the models using
script/generate and updated them with has_many and belongs_to. Now I
build a form with a select box with all of the state names and ids.
When I create the locator, I try:

    locator = Locator.new()
    locator.state_id = params[:stateid]

Now ruby complains that there is no state_id attribute. There is an
attribute "state" but it wants a whole state object, which I guess I
could create, but it seems silly. I suspect it it more likely that I am
doing something wrong. Can someone who actually knows what they are
doing tell me what it is? Thanks in advance.