Hi Rails Community,
First time poster, long time Rails user, hoping to be contributing soon. I’m not sure if this has been covered before, I did search though, promise!
In any case, I fixed a bug at work recently, where we were sending a blank
'' param value somehow (not super important in the context of this topic), which was then getting through params.fetch without raising an error.
Digging into the rails code, I found this curious as the error message specifically says:
ActionController::ParameterMissing: param is missing or the value is empty: :param_name
Interestingly, this doesn’t raise in our application for empty string, however the behaviour of empty? is to return true for an empty string ‘’.
''.empty? => true
Could/should this error message be improved? Or have I got it totally wrong? Look forward to hearing from someone who knows more than me about this!