Just add to your link:

  :target => '_blank'

In your exemple, made this:

  link_to "foo", foo_path(foo), :target => '_blank'

Steve Murdoch wrote:
> I'm having trouble writing the required javascript to open a link in a
> new browser window in Rails3.
> 
> Previously, in rails2.3.x I could just do:
> 
>     link_to "foo", foo_path(foo), :popup => true
> 
> But now in Rails3, this option has been deprecated and the only other
> way I can imagine doing this would be to use link_to_function but that
> has also been nuked so I can't figure this out.
> 
> Can anyone give me some pointers please?
> 
> Thanks
> 
> PS: I'm specifically looking to open a new browser-window, as opposed
> to a modal-box or a jquery dialogue as I need it to stay alive whilst
> the user continues to browse the site...

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to