Nested models and forms


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


def add_job_profile_link(name, form, vacancy)

link_to_function name do |page|

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

  page << %{

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



<div id="job_profiles">

   <%= render(:partial => 'job_profile', :locals => { :f => f, :job_profile => }) %>


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


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 has different meanings in view and helper?