Open new window problem

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

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 S. - http://mentalized.net

<%= 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!!

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