I googled that there is an is_a? function to check whether an object is an integer or not.
is_a?
But I tried in rails console, and it doesn\'t work.
I
You forgot to include the class you were testing against:
"1".is_a?(Integer) # false 1.is_a?(Integer) # true