I'm finding with Sinatra 2.0.0 that a form submission has params that contain an obscure key/value pair with the key being captures, value being []. I am trying to take this out in a method using:
incoming.delete('captures')
This doesn't work. I continue to get values from the params hash, and is giving me an error:
App 30407 stderr: 2018-01-17 17:09:15 - NoMethodError - undefined method `values' for []:Array
All of this is confusing as when I test in another test script, it works just fine as expected, just deleting the key/value pair in the hash:
c = {"u"=>"Alpha", "s"=>"zulu", "captures"=>[]}
c.delete('captures')
puts c.class # => hash
Is there an alternative way of getting rid of this obscure entry in my params hash, or can I pass params to a method to take it out somehow? I need to do things with the normal params hash that I am expecting. Apparently Sinatra 2.0.0 introduced this new params entry.
I'm finding with
Sinatra 2.0.0that a form submission hasparamsthat contain an obscure key/value pair with the key beingcaptures, value being[]. I am trying to take this out in a method using:This doesn't work. I continue to get values from the params hash, and is giving me an error:
All of this is confusing as when I test in another test script, it works just fine as expected, just deleting the key/value pair in the hash:
Is there an alternative way of getting rid of this obscure entry in my
paramshash, or can I pass params to a method to take it out somehow? I need to do things with the normalparamshash that I am expecting. ApparentlySinatra 2.0.0introduced this newparamsentry.