albert
February 10, 2007, 9:54pm
1
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
albert
February 10, 2007, 10:18pm
2
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
albert
February 26, 2007, 2:02pm
3
<%= 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!!
albert
February 27, 2007, 4:01am
4
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