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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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'
    else
      render :action => 'edit'
    end
  end

I would like to change:
redirect_to :action => 'show'
with:
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();
</script>'
This topic is locked and can not be replied to.