# Creating a new record in a pop-up-window

**URL:** <https://www.ruby-forum.com/t/creating-a-new-record-in-a-pop-up-window/182096>\
**Category:** Rails\
**Created:** [January 22, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/creating-a-new-record-in-a-pop-up-window/182096 "2010-01-22T16:27:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [January 22, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/creating-a-new-record-in-a-pop-up-window/182096/1 "2010-01-22T16:27:08Z")

</div>

hi,

i have a Project-Task model association. The Project: SHOW & EDIT list  
the tasks…now:

i want to have a pop-up-window triggered in the edit view. the  
pop-up-window should show a basic Task-NEW form, BUT with some  
information about the Project, eg the title of the project. after  
submitting i want to get the Project -EDIT View to be reloaded.

1. i have the pop-up window:  
\<%=link\_to\_remote “Add Tasks”, :url =\> { :action =\> “open\_new\_window”,  
:projectid=\>@bol.id } %\>

2)controller  
def open\_new\_window  
p “\>\>Open Window: #{params[:projectid]}”  
render :update do |page|

page \<\< “window.open(’/bol\_lines/new’, ‘A Window’,  
‘left=20,top=20,width=500,height=500,toolbar=1,resizable=0’ );”  
end#end render page

end

1. how do i get the projectid into the new pop-upwindow to to show the  
title and ultimately into the db to store the right foreign-key?

thx  
tom
