I am using a route like this
match \"/v1/:method\" => \"v1#index\"
My intention here is capture the name of the api method and then send the
Stolen from the work of a colleague. I find this a slightly more robust solution, since it will work even if there are changes to the path parameters:
params.except(*request.path_parameters.keys)