From 5bd2cc99df654ff1d515493197ec14e208440a9a Mon Sep 17 00:00:00 2001
From: Gregory Jacobs
Date: Mon, 26 Sep 2011 16:36:59 -0400
Subject: [PATCH] Passed along any original 'target' attribute to the generated
form tag in handleMethod()
---
src/rails.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/rails.js b/src/rails.js
index 40223c0b..a870ce0a 100644
--- a/src/rails.js
+++ b/src/rails.js
@@ -159,9 +159,10 @@
handleMethod: function(link) {
var href = link.attr('href'),
method = link.data('method'),
+ target = link.attr('target') || "", // to pass along any original 'target' attribute to the form tag
csrf_token = $('meta[name=csrf-token]').attr('content'),
csrf_param = $('meta[name=csrf-param]').attr('content'),
- form = $(''),
+ form = $(''),
metadata_input = '';
if (csrf_param !== undefined && csrf_token !== undefined) {