Closed Cifer-Y closed 8 years ago
In my API route, I have a param like below:
params do requires :opt_in, type: Boolean end
Then I visit my api, I found a strange question:
If my param is {"opt_in": false}, it will report that I didn't pass opt_in to it.
opt_in
But {"opt_in": true}, {"opt_in": "true"}, {"opt_in": "false"} all worked well.
{"opt_in": true}, {"opt_in": "true"}, {"opt_in": "false"}
Confused.
In my API route, I have a param like below:
Then I visit my api, I found a strange question:
If my param is {"opt_in": false}, it will report that I didn't pass
opt_in
to it.But
{"opt_in": true}, {"opt_in": "true"}, {"opt_in": "false"}
all worked well.Confused.