mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Use this.href, not unexisting url
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2150 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -266,7 +266,7 @@ module ActionView
|
||||
end
|
||||
|
||||
def post_javascript_function
|
||||
"f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = url; f.submit();"
|
||||
"f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit();"
|
||||
end
|
||||
|
||||
# Processes the _html_options_ hash, converting the boolean
|
||||
|
||||
@@ -90,7 +90,7 @@ class UrlHelperTest < Test::Unit::TestCase
|
||||
|
||||
def test_link_tag_using_post_javascript
|
||||
assert_equal(
|
||||
"<a href=\"http://www.example.com\" onclick=\"f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = url; f.submit();return false;\">Hello</a>",
|
||||
"<a href=\"http://www.example.com\" onclick=\"f = document.createElement('form'); document.body.appendChild(f); f.method = 'POST'; f.action = this.href; f.submit();return false;\">Hello</a>",
|
||||
link_to("Hello", "http://www.example.com", :post => true)
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user