Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails 3, in link_to how specify target AND optional url params?

I got extra url params working fine with my link_to , but cannot figure out how to make the link open into a a new window or tab

I tried :target => "_blank" in several places, but it always throws a syntax error

here's what I have before specifying a target:

= link_to "click here", :controller=>"widget", :action=>"mypage", :extraparam => "foobar"
like image 473
jpw Avatar asked Feb 25 '11 01:02

jpw


1 Answers

Try this:

link_to "click here", { :controller=>"widget", :action=>"mypage", :extraparam => "foobar" }, :target => "_blank"
like image 180
ctcherry Avatar answered Oct 29 '22 17:10

ctcherry