has_many show partial new foreign key - help

Hi i have a 1-N Model: Company<>Division. everything is default. I want to have a Division/new partial in the Company/show view. so what i did was copying the new to _new and render it with: Company/show: <p>   <b>Title:</b>   <%=h @account.title %> </p> .....

<%= render :partial=>'contacts/new', :local=>@contact=Contact.new %>


but now i dont know hoe to get the @acount_id into the Division-Model as foreign key!? what do i need to do here?


could you:

<%= render_partial 'contacts/new', nil, 'contact' => Contact.new, 'account' => @account.id %>

i tried:

<%= render :partial=>'contacts/new', nil, :contact=> Contact.new, :account=> @account.id %>

but this didnt work: compile error /var/www/railapps/TEST5/app/views/accounts/show.html.erb:8: syntax error, unexpected ',', expecting tASSOC _erbout.concat(( render :partial=>'contacts/new', nil, :contact=> Contact.new, :account=> @account.id ).to_s); _erbout.concat "\n"                                                       ^ /var/www/railapps/TEST5/app/views/accounts/show.html.erb:8: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.' _erbout.concat(( render :partial=>'contacts/new', nil, :contact=> Contact.new, :account=> @account.id ).to_s); _erbout.concat "\n"

Any difference if you take that nil arg out of there?

If not, maybe this would work:

<%= render :partial=>'contacts/new', :contact => Contact.new(:account_id => @account.id) %>