This patch fixes the 'link_to' method when the ':method' option is set to ':delete' and a ':target' option is given in html_options.
When the link_to method is passed the ':method => :delete' option, it yields an anchor tag with an onclick event that creates and submits a form. All user defined options are included in this form, except the :target option.
link_to("Destroy", "http://www.thijslangeveld.nl", :method => :delete, :target => '_top')
should yield:
<a href='http://www.thijslangeveld.nl' onclick=\"var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;f.target = this.target;var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', '_method'); m.setAttribute('value', 'delete'); f.appendChild(m);f.submit();return false;\" target=\"_top\">Destroy</a>
Instead, it lacks the 'f.target = this.target' part. This means that the request will always render in the current window while it should be rendered in the window that is designated by the target option, if present.