Skip to content

params Hash Contains Persistent 'captures' Key #1380

@daBee

Description

@daBee

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions