Specifying a :target when using link_to with Rails 3.1

This seems contrary to some of the docs I’ve read, so I’ll mention it here in case anyone else has this trouble.

When specifying a :target => “blank” as part of a linkto, I had to put the destination url parameters inside a hash:

= link_to "Preview", { :action => :preview, :id => flyer}, :target => "_blank"

= link_to "Preview", :action => :preview, :id => flyer, :target => "_blank"

Otherwise the target=_blank is treated as a text query string instead of as a target directive.