Browse files

Merge remote branch 'mutle/master'

  • Loading branch information...
2 parents 3672ce4 + 83c5c25 commit 54b91a6bc761d95c4e5d6955e07b8630f865e15d @joakimk committed Dec 26, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/webrat/core/elements/link.rb
View
6 lib/webrat/core/elements/link.rb
@@ -62,15 +62,17 @@ def onclick
end
def http_method
- if !onclick.blank? && onclick.include?("f.submit()")
+ if @element["data-method"] && %w(get post put delete).include?(@element["data-method"])
+ @element["data-method"].to_sym
+ elsif !onclick.blank? && onclick.include?("f.submit()") || @element["data-method"]
http_method_from_js_form
else
:get
end
end
def http_method_from_js_form
- if onclick.include?("m.setAttribute('name', '_method')")
+ if !onclick.blank? && onclick.include?("m.setAttribute('name', '_method')")
http_method_from_fake_method_param
else
:post

0 comments on commit 54b91a6

Please sign in to comment.