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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 November 2006 13:17, Narayana Karthick 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.> 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.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
karthick.glinfo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-27 11:11 UTC
Re: Open new Window
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 Nov 2006, at 12:11, karthick.glinfo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I know how to open new window in html & in java script. > but i want to open new window by using rails functions.http://www.rubyonrails.org/api/classes/ActionView/Helpers/ 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 November 2006 14:11, karthick.glinfo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 Nov 2006, at 12:26, Maxim Kulkin wrote:> 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''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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt wrote:> On 27 Nov 2006, at 12:26, Maxim Kulkin 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 BerdtHi 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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 <a> ''target'' attributes isn''t even present in the HTML 4.01 Strict version :) Gareth, Saving the world one small inaccuracy at a time ;) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 Nov 2006, at 13:23, Gareth Adams 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 <a> ''target'' attributes isn''t > even present in > the HTML 4.01 Strict version :)One more reason not to use it ;-) Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---