Nested models and forms

Hi,

I have been trying to use the new nested models & forms feature in rails 2.3

#helper

def add_job_profile_link(name, form, vacancy)

link_to_function name do |page|

  profile = render(:partial => 'job_profile', :locals => { :f => form, :job_profile => vacancy.job_profiles.build })

  page << %{

    $('job_profiles').insert({ bottom: "#{ escape_javascript profile }"});

  }
end

end

#view
<div id="job_profiles">

   <%= render(:partial => 'job_profile', :locals => { :f => f, :job_profile => @vacancy.job_profiles.build }) %>

</div>
<p>

   <%= add_job_profile_link("Add a job profile", f, @vacancy) %>

</p>

The above code is displaying the fields, but on submission picks up values for just 2 nested models. I tried removing the default rendered partial, and then it picks up just 1 set of values.

Am i doing something wrong over here?
Does @vacancy.job_profiles.build has different meanings in view and helper?

Regards