# Question closing page after action

**URL:** <https://www.ruby-forum.com/t/question-closing-page-after-action/64253>\
**Category:** Rails\
**Created:** [June 23, 2006, 4:07pm UTC](https://www.ruby-forum.com/t/question-closing-page-after-action/64253 "2006-06-23T16:07:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c77e96/32.png) [@shai](https://www.ruby-forum.com/u/shai)\
**Post date:** [June 23, 2006, 4:07pm UTC](https://www.ruby-forum.com/t/question-closing-page-after-action/64253/1 "2006-06-23T16:07:23Z")

</div>

Hi all,

does anyone know of a rails command i can use so that at the end of an  
action, the page will close at termination? (i.e it would be the  
equivalent of a javascript and would  
look something like this

def create  
@contact = Contact.new(params[:contact])  
if @contact.save  
:action =\> :closewindow ## or something like this? ##  
else  
render\_text ‘you have failed…’  
end  
end

thanks in advance,

s

---

<div class="post-metadata">

**Author:** ![shai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c77e96/32.png) [@shai](https://www.ruby-forum.com/u/shai)\
**Post date:** [June 23, 2006, 5:54pm UTC](https://www.ruby-forum.com/t/question-closing-page-after-action/64253/2 "2006-06-23T17:54:37Z")

</div>

You could use RJS to update an element with the enclosed javascript.  
The browser should execute the javascript (I’ve done this with  
redirection on remote forms on [http://heartbeat.highgroove.com](http://heartbeat.highgroove.com)).

- Derek

On 6/23/06, shai [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> :action => :closewindow ## or something like this? ##
> 
> ```
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Derek H.  
HighGroove Studios - [http://www.highgroove.com](http://www.highgroove.com)  
San Mateo, CA | Atlanta, GA  
Keeping it Simple.  
650.276.0908
