Hi Santosh,

Try to use 'link_to' helper. Make the following lines your return value:

<%= link_to image_tag('http://localhost:3000/images/pic.jpg', :height => 106, 
:width => 148, :alt => "Bild1"), "http://somepath.de";, :popup => true %>

I used this in my thesis project and I hope it works for you too.

Cheers
Hidayat Sun


--- On Mon, 13/4/09, santosh bt <[email protected]> wrote:

From: santosh bt <[email protected]>
Subject: [rails-development] how to open external links in different window.
To: "ruby-on-rails-programming-with-passion" 
<[email protected]>
Date: Monday, 13 April, 2009, 10:01 AM

Hi all,
  I have some sposors adds in my website.. those are the external links, 
whenever they are clicked , it should be opened in new window. but instead its 
opening in same window.


in view.. .  
---------------------------------------------------------------------------------------------------------------------------------

  <%= show_industry_sponsor(@community.industry) %>  
---------------------------------------------------------------------------------------------------------------------------------
in application_helper, I have written code.

-----------------------------------------------------------------------------------------------------------------------------------
def show_industry_sponsor(industry)

  case industry

  when "Information Services"


     return "<a href='http://www.xxx.com' 
onclick='window.open(this.href,'_blank');return false;' ><img 
src='http://somepath' title='xxx'/></a>"


  when 'Information Technology and Services'
   
     
     return "<a href='http://www.xxx.com'
onclick='window.open(this.href,'_blank');return false;' ><img
src='http://somepath' title='xxx'/></a>"
  end

end

-----------------------------------------------------------------------------------------------------------------------------------------------------------------



please somebody suggest me that what is causing it to open in the same window, 
and how to overcome this. 

-- 
Regards,
Santosh Turamari.








      
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
ruby-on-rails-programming-with-passion-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to