From 129a159d1247b2bc9cc791a81ef3485e5b061648 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 18 Mar 2006 16:25:11 +0000 Subject: Fixed link_to "somewhere", :post => true to produce valid XHTML by using the parentnode instead of document.body for the instant form (closes #3007) [Bob Silva] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3928 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/url_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index b3dd58370e..1abe1b1220 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -269,7 +269,7 @@ module ActionView end def post_javascript_function - "var f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit();" + "var f = document.createElement('form'); this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit();" end # Processes the _html_options_ hash, converting the boolean -- cgit v1.2.3