Forum: Ruby on Rails open new window problem

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.
E2592af2ea700cc8461e93c12ea9dd97?d=identicon&s=25 albert (Guest)
on 2007-02-10 21:54
I try to open a pdf file in a new window using the following code:

<%= link_to document.name, :controller => 'member',
:action => :show_attachment, :id => document.id,
:popup => ['new window', 'width=800, height=700, left = 450, top = 100,
resizable, scrollbars=yes' ] %>

but it opens the file in the same window.
Any ideas why?

Many thanks,
-Albert
317aad7f9f0b69a440faca74bbe22b20?d=identicon&s=25 Jakob Skjerning (Guest)
on 2007-02-10 22:18
(Received via mailing list)
On Feb 10, 2007, at 21:54 , albert wrote:

>
> I try to open a pdf file in a new window using the following code:
>
> <%= link_to document.name, :controller => 'member',
> :action => :show_attachment, :id => document.id,
> :popup => ['new window', 'width=800, height=700, left = 450, top =
> 100,
> resizable, scrollbars=yes' ] %>

You're passing the :popup options to the url options hash. You want
to pass it as part of the html_options hash, like this:

<%= link_to document.name, {:controller => 'member', :action
=> :show_attachment, :id => document.id}, :popup => ['new window',
'width=800, height=700, left = 450, top = 100, resizable,
scrollbars=yes' ] %>

--
Jakob Skjerning - http://mentalized.net
1f2eadfb41362800ebc2cf211b91d0f7?d=identicon&s=25 javier ramirez (Guest)
on 2007-02-26 14:02
(Received via mailing list)
> <%= link_to document.name, :controller => 'member',
> :action => :show_attachment, :id => document.id,
> :popup => ['new window', 'width=800, height=700, left = 450, top = 100,
> resizable, scrollbars=yes' ] %>
>
> but it opens the file in the same window.
> Any ideas why?
>
I've found that IE (surprise) is a bit strange when it comes to poup
titles. If the title contains any spaces then it will open in the same
window. I've observed this behaviour on IE6 so, just in case, no more
spaces in my popup windows' titles.

regards,

javier ramirez

--
--------
Estamos de estreno... si necesitas llevar el control de tus gastos
visita http://www.gastosgem.com !!Es gratis!!
558a1355cd9f2584c80afdd92ec984d2?d=identicon&s=25 Shauna (Guest)
on 2007-02-27 04:01
I had the same problem. Check out this post - it solved the problem for
me too.

http://www.ruby-forum.com/topic/81000#190602

Shauna
This topic is locked and can not be replied to.