Open new Window

hi guys,

how to open new window using any rails function.

now am using redirect_to “http://chennairails.blogspot.com
but it opens in same window.

I want to open a specific link in new window by using rails function
only.

how can i do this. please explain with example code.

advance thx,

Regards,
karthick.

On 27 November 2006 13:17, Narayana K. wrote:

how to open new window using any rails function.

now am using redirect_to “http://chennairails.blogspot.com
but it opens in same window.
Opening new window is only possible on client side (either with
target=“_blank” or with some javascript magick).

I suggest you to go and study HTML first. After that you’ll be able to
easily
figure out how to do it.

hi,

I know how to open new window in html & in java script.
but i want to open new window by using rails functions.

ok bye

On 27 Nov 2006, at 12:11, [email protected] wrote:

I know how to open new window in html & in java script.
but i want to open new window by using rails functions.

UrlHelper.html#M000378

link_to “Busy loop”, { :action => “busy” }, :popup => [‘new_window’,
‘height=300,width=600’]

If you need to do it from your controller, you’ll need to use RJS to
do it:

page.call “window.open('”+myurl+“');”

Best regards

Peter De Berdt

On 27 Nov 2006, at 12:26, Maxim K. wrote:

link_to ‘Cool site’, “http://mycoolsite.example.com”, :target =>
‘_blank’

The :popup parameter just does that. Also, you musn’t forget XHTML
1.1 has deprecated the _target parameter in favor of JavaScript.

Best regards

Peter De Berdt

Peter De Berdt wrote:

On 27 Nov 2006, at 12:26, Maxim K. wrote:

link_to ‘Cool site’, “http://mycoolsite.example.com”, :target =>
‘_blank’

The :popup parameter just does that. Also, you musn’t forget XHTML
1.1 has deprecated the _target parameter in favor of JavaScript.

Best regards

Peter De Berdt

Hi friendz,

Thank you very much for your replies.

do visit my blog for Rails Information.

http://chennairails.blogspot.com

thank you very much
ok bye

Regards,
Karthick.

Peter De Berdt <peter.de.berdt@…> writes:

The :popup parameter just does that. Also, you musn’t forget XHTML 1.1 has
deprecated the _target parameter in favor of JavaScript.

While it’s good news that people are pushing standards compliance, this
isn’t
anything to do with XHTML 1.1. The ‘target’ attributes isn’t even
present in
the HTML 4.01 Strict version :slight_smile:

Gareth,
Saving the world one small inaccuracy at a time :wink:

On 27 Nov 2006, at 13:23, Gareth A. wrote:

The :popup parameter just does that. Also, you musn’t forget XHTML
1.1 has
deprecated the _target parameter in favor of JavaScript.

While it’s good news that people are pushing standards compliance,
this isn’t
anything to do with XHTML 1.1. The ‘target’ attributes isn’t
even present in
the HTML 4.01 Strict version :slight_smile:

One more reason not to use it :wink:

Best regards

Peter De Berdt

On 27 November 2006 14:11, [email protected] wrote:

I know how to open new window in html & in java script.
but i want to open new window by using rails functions.

If you want link to open in another window, you supply A tag’s “target”
attribute with “_blank” value.

In Rails to render a link you use link_to helper. So, you just need to
pass
that “target=‘_blank’” to link_to function. link_to accepts html options
as
third param, so:

link_to ‘Cool site’, “http://mycoolsite.example.com”, :target =>
‘_blank’