A better solution would be to have a way to indicate "this parameter needs to be this type".
params[:id] could be a string, integer, hash, or array when accessed in the controller actions.
params[:id] could be a string, integer, hash, or array when accessed in the controller actions.
If only there were some kind of concept of typing, perhaps enforced by the language and statically applied, which would eliminate this class of error entirely...boy, that would be helpful in larger systems.