Topic: Nested form with jquery dialog, how?

Hi,
I would like to do something in JQuery.
My dialog works .. but i would like to link it with a _form.

I would like to have a link like : link_to_add and link_to_remove from nested_form gem, but when we click on link_to_add, that open my dialog.

Is it possible? i tried <%= f.link_to_add 'Open Dialog', :id => 'mustopendialog' %>

my jquery are :

$("#mustopendialog").click(function() {
  $("#dialog").dialog();
});

and i would like to know if the dialog can ben auto generated by the nested model? for now my dialog box are like

<div id='dialog'>
username : 
<input type='text' name='uname'>
</div>

i would like to have a submit button on my dialog to add the content to my fields_for like my other nested form.
I have read something about
<div id="dialog">
<%= render @mynestedform %>
</div>
but i get always error about render partial mynestedform/mynestedform ....

i have no idea how to do nested dialog form.
google don't want to help me too!  i use Rails 3.0.9
i checked with railscasts for video #205 Unobtrusive Javascript  but its not what i'm looking for.

Thanks for your help!