I'm running Rails 5.0.0.1, and have a controller called Voice::NumbersController, accessible by a route like:
scope '/api' do
namespace :v1 do
namespace :voice do
resources :numbers
end
end
end
I want to have an optional parameter "number". For some reason, a GET request to /api/v1/voice/numbers with no params gets params[:numbers]
passed to it when I have Content-Type: application/json in the request.
Is this because a GET with a body confuses things? If I put some content in the body (i.e. "hello": 5), I get the following:
Parameters: {"_json"=>"hello: 5", "number"=>{"_json"=>"hello: 5"}}
This doesn't make much sense to me - it seems reasonable that "_json" is set, but not "number".
Is there a way to disable this automatic inclusion of the "number" param?