3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/capybara/mechanize/form.rb', line 3
def params(button)
if !use_mechanize?
return super
end
node = {}
class << node
def search(*args); []; end
end
node['method'] = button && button['formmethod']
node['method'] ||= (respond_to?(:request_method, true) ? request_method : method).to_s.upcase
if self.multipart?
node['enctype'] = 'multipart/form-data'
else
node['enctype'] = 'application/x-www-form-urlencoded'
end
@m_form = Mechanize::Form.new(node, nil, form_referer)
super
@m_form
end
|