# Staying in the same browser window?

**URL:** <https://www.ruby-forum.com/t/staying-in-the-same-browser-window/72861>\
**Category:** Rails\
**Created:** [October 19, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/staying-in-the-same-browser-window/72861 "2006-10-19T13:22:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [October 19, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/staying-in-the-same-browser-window/72861/1 "2006-10-19T13:22:28Z")

</div>

```
Hi,

I am a newbie to RoR. I have the following question:
     Suppose there is a link in a view (MyView) which opens
     a third party graphics application(3PGA). The control
     returns back to Rails after manipulation in 3PGA. But
     the problem is now MyView opens up a new browser window.
     I wish to stay in the current window itself. How do
     I do it?

Thanks and if you didn't understand it, I can make it clearer.

Best,
Ram.
```

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [October 19, 2006, 2:12pm UTC](https://www.ruby-forum.com/t/staying-in-the-same-browser-window/72861/2 "2006-10-19T14:12:19Z")

</div>

Hi Chris,

> This sounds like a problem with the way the ‘third party graphics  
> application’ is re-launching the URL in the browser. Doesn’t seem like  
> it’s a Rails-related problem.

May be not… because there is already the same application  
with coldfusion that is able to open in the previous browser  
window itself.

> Is the ‘third party graphics application’ an actual separate  
> application that is running on the user’s computer? Or does it run in  
> the browser somehow?

Its a GIS application and runs in the browser. Whenever an event  
like mouseclick happens, then it talks back to the called application  
alongwith some information.

Hope that helps…

Thanks,  
Shankar.

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [October 19, 2006, 2:03pm UTC](https://www.ruby-forum.com/t/staying-in-the-same-browser-window/72861/3 "2006-10-19T14:03:27Z")

</div>

Ram wrote:

> ```
> I am a newbie to RoR. I have the following question:
> Suppose there is a link in a view (MyView) which opens
> a third party graphics application(3PGA). The control
> returns back to Rails after manipulation in 3PGA. But
> the problem is now MyView opens up a new browser window.
> I wish to stay in the current window itself. How do
> I do it?
> 
> ```

This sounds like a problem with the way the ‘third party graphics  
application’ is re-launching the URL in the browser. Doesn’t seem like  
it’s a Rails-related problem.

Is the ‘third party graphics application’ an actual separate  
application that is running on the user’s computer? Or does it run in  
the browser somehow?

Chris

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [October 19, 2006, 5:06pm UTC](https://www.ruby-forum.com/t/staying-in-the-same-browser-window/72861/4 "2006-10-19T17:06:24Z")

</div>

Ram wrote:

> > This sounds like a problem with the way the ‘third party graphics  
> > application’ is re-launching the URL in the browser. Doesn’t seem like  
> > it’s a Rails-related problem.
> 
> May be not… because there is already the same application  
> with coldfusion that is able to open in the previous browser  
> window itself.

Your best bet will be to compare the HTML that is being produced by  
Rails, and see how it is different from the HTML that the Coldfusion  
version is producing. Maybe there is some different parameters being  
passed to the GIS app, or there’s some different JavaScript or  
something.

Also, have a look at the URL in the browser address bar, and the URL  
that the GIS app is generating – there’s a slight chance that it’s to  
due to some odd discrepancy between URLs that didn’t exist in the  
Coldfusion version.

But generally, apart from the contents of the HTML and the URLs  
involved, I can’t see any way that anything on the server-side that  
will affect whether your browser opens the URL in a new window or in  
the same window. It really doesn’t look like a Rails-specific problem.

Chris

---

<div class="post-metadata">

**Author:** ![ram](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@ram](https://www.ruby-forum.com/u/ram)\
**Post date:** [October 20, 2006, 3:47pm UTC](https://www.ruby-forum.com/t/staying-in-the-same-browser-window/72861/5 "2006-10-20T15:47:59Z")

</div>

> Your best bet will be to compare the HTML that is being produced by  
> Rails, and see how it is different from the HTML that the Coldfusion  
> version is producing. Maybe there is some different parameters being  
> passed to the GIS app, or there’s some different JavaScript or  
> something.
> 
> Also, have a look at the URL in the browser address bar, and the URL  
> that the GIS app is generating – there’s a slight chance that it’s to  
> due to some odd discrepancy between URLs that didn’t exist in the  
> Coldfusion version.
> 
> But generally, apart from the contents of the HTML and the URLs  
> involved, I can’t see any way that anything on the server-side that  
> will affect whether your browser opens the URL in a new window or in  
> the same window. It really doesn’t look like a Rails-specific problem.

Thanks for your reply. I think there is some javascript which  
I may have to look at !

A slightly different question: in the above scenario, after I click  
on the link in my view, it doesn’t paste the url of the link (which is  
the GIS popup) in the address bar but the url remains the same. Is it  
possible to paste this url of the link in the address bar?  
(I guess this is a rails question or? 😉 )

Best,  
Ram
