Adapt StopTime::Mab#mab_done to follow Mab 0.0.3 API changes
This commit is contained in:
parent
aa79757af4
commit
800dd3106f
|
@ -88,13 +88,13 @@ module StopTime::Mab
|
||||||
SUPPORTED = [:get, :post]
|
SUPPORTED = [:get, :post]
|
||||||
|
|
||||||
def mab_done(tag)
|
def mab_done(tag)
|
||||||
return super unless tag.name == :form
|
return super unless tag._name == :form
|
||||||
|
|
||||||
meth = tag.attributes[:method]
|
meth = tag._attributes[:method]
|
||||||
tag.attributes[:method] = 'post' if override = !SUPPORTED.include?(meth)
|
tag._attributes[:method] = 'post' if override = !SUPPORTED.include?(meth)
|
||||||
# Inject a hidden input element with the proper method to the tag block
|
# Inject a hidden input element with the proper method to the tag block
|
||||||
# if the form method is unsupported.
|
# if the form method is unsupported.
|
||||||
tag.block do |orig_blk|
|
tag._block do |orig_blk|
|
||||||
input :type => 'hidden', :name => '_method', :value => meth
|
input :type => 'hidden', :name => '_method', :value => meth
|
||||||
orig_blk.call
|
orig_blk.call
|
||||||
end if override
|
end if override
|
||||||
|
|
Loading…
Reference in New Issue