Permalink
Browse files

Honor HTML5 data-method attribute

  • Loading branch information...
1 parent 3623b62 commit e8d0545a800509bf37d7c00274f43443c7a6f3a1 Rob Sanheim and Jamie Kite committed Mar 26, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/relevance/tarantula/link.rb
@@ -68,11 +68,13 @@ def make_result(response)
def method
@method ||= begin
- (@tag &&
- [:put, :delete, :post].detect do |m| # post should be last since it's least specific
- @tag['onclick'] =~ METHOD_REGEXPS[m]
- end) ||
- :get
+ (
+ @tag &&
+ [:put, :delete, :post].detect do |m| # post should be last since it's least specific
+ @tag['onclick'] =~ METHOD_REGEXPS[m] ||
+ @tag['data-method'] == m.to_s
+ end
+ ) || :get
end
end

0 comments on commit e8d0545

Please sign in to comment.