Forum: Ruby on Rails how to close the window on def update?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Patrick A. (Guest)
on 2006-05-13 21:09
(Received via mailing list)
hey all,
I have my usual update  function like this:
  def update
    @document = Document.find(params[:id])
    if @document.update_attributes(params[:document])
      flash[:notice] = 'Document was successfully updated.'
      redirect_to :action => 'show'
      render :action => 'edit'

I would like to change:
redirect_to :action => 'show'
something "window.close()"

any idea?

Thanx in advance
Patrick A. (Guest)
on 2006-05-13 21:33
(Received via mailing list)
for those who care, this is how I fixed it:
render :text => '<script type="text/javascript">window.close();
This topic is locked and can not be replied to.