Created
May 19, 2009 14:11
-
-
Save ajtack/114112 to your computer and use it in GitHub Desktop.
Specifically enables the use of PUT and DELETE verbs in Rails forms. Rails' convention to override browsers' ignorance of these verbs is a hidden input field.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Webrat | |
class Form | |
protected | |
def form_method | |
special_method = Webrat::XML.css_search(@element, 'input[name="_method"]').first | |
unless special_method.nil? | |
special_method['value'] | |
else | |
Webrat::XML.attribute(@element, "method").blank? ? :get : Webrat::XML.attribute(@element, "method").downcase | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment