problem popup

hello list.

I use popup in my project

<td width="10"><%= link_to image_tag("edit.png"),
edit_mercado_path(mercado),
:popup =>['subjects',
'width=500,height=500,toolbar=no,titlebar=no,status=no,left=500,top=300,
scrollbars=yes']%></td>

I want that update method finish this new window (popup) close and
refresh the father window

now I use javascript to close window

<td><%= submit_tag "Aceptar" :onclick=>"window.close();" %></td>

but I want user render :update but this don´t run

I put this

def update
  ............
render :update do |page|
     page << opener.$('contenerabajo')
     page << eval(window.close():wink:

end
end

any idea???
thanks for all