Closed kinsomicrote closed 1 year ago
What's the request's content type that you're sending? If you're using curl, feel free to include the request as an example.
Typically, index
actions use the GET method, and I'm not sure GET allows a request body.
The request content type is application/json and I am making use of Postman.
I get the same error when I use POST
method. If I have a typed param like this:
typed_params do
param :title, type: :string
param :number, type: :integer
param :period, type: :string
end
And I send a payload like this;
{
"title": "Testing",
"period": "Human",
"number": 6
}
But this works;
typed_params do
params :record, type: :hash do
param :title, type: :string
param :number, type: :integer
param :period, type: :string
end
end
With a payload like this;
{
"record": {
"title": "Sitepoint",
"period": "Human",
"number": 6
}
}
I can't reproduce this: https://gist.github.com/ezekg/d913007bbf93f94a6c741f08d12d8bcc
Can you provide a failing test? What does the unpermitted param error message say?
Closing due to lack of response. Feel free to reopen with a reproduction script.
Hello, first, thanks for this gem. This is a fit for a solution I've been looking for.
I'm trying to create a typed param specific to a controller action, so I have something like this;
Following the documentation, I expect that this should work;
But it does not, I get the error;
unpermitted parameter
. Any hint on what I might be missing?