# Open new window

**URL:** <https://www.ruby-forum.com/t/open-new-window/95393>\
**Category:** Rails\
**Created:** [January 17, 2006, 7:32am UTC](https://www.ruby-forum.com/t/open-new-window/95393 "2006-01-17T07:32:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santiago\_Hirschfeld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@Santiago\_Hirschfeld](https://www.ruby-forum.com/u/Santiago_Hirschfeld)\
**Post date:** [January 17, 2006, 7:32am UTC](https://www.ruby-forum.com/t/open-new-window/95393/1 "2006-01-17T07:32:32Z")

</div>

First, I’m _very_ new in rails, i’m loving it and didn’t encounter any  
problems in the simple tasks i’m doing yet.

What I’d like to do is to open a new window containing the info of a  
Model  
(something like the show scaffold method) with a simple “close” link to  
close the window.

Can someone please give me some directions?

thanks in advance.

Santiago

---

<div class="post-metadata">

**Author:** ![Santiago\_Hirschfeld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@Santiago\_Hirschfeld](https://www.ruby-forum.com/u/Santiago_Hirschfeld)\
**Post date:** [January 17, 2006, 9:14am UTC](https://www.ruby-forum.com/t/open-new-window/95393/2 "2006-01-17T09:14:48Z")

</div>

On 16 Jan '06, at 9:54 PM, Santiago Hirschfeld wrote:

> What I’d like to do is to open a new window containing the info of  
> a Model (something like the show scaffold method)

In HTML, you use a link whose target is ‘\_new’:

In a Rails app you would use the HTML options hash of the link\_to  
method to set :target=\>’\_new’.

> with a simple “close” link to close the window.

Every window already comes with a standard “close” button at the top.  
I’ve never understood why some web sites feel they need to add a  
special link to help the user out.

But if you really want to do it, you’ll need a bit of JavaScript to  
close the current window, then make a link whose href is  
“javascript:” followed by the script.

–Jens

---

<div class="post-metadata">

**Author:** ![Santiago\_Hirschfeld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@Santiago\_Hirschfeld](https://www.ruby-forum.com/u/Santiago_Hirschfeld)\
**Post date:** [October 2, 2007, 3:58pm UTC](https://www.ruby-forum.com/t/open-new-window/95393/3 "2007-10-02T15:58:17Z")

</div>

Jens A. wrote:

> On 16 Jan '06, at 9:54 PM, Santiago Hirschfeld wrote:

> But if you really want to do it, you’ll need a bit of JavaScript to  
> close the current window, then make a link whose href is  
> “javascript:” followed by the script.
> 
> –Jens

Hi,

I am new to RoR I want to show a new window but as a popup window that  
should not be shown on the taskbar, Please help me…You can reply  
me on my e-mail.

Regards,  
Kiran P.,  
removed\_email\_address@domain.invalid
