string to an int ruby code example
Example 1: integer to string ruby
my_int = 69
my_int_to_string = my_int.to_s
puts my_int.class # Integer
puts my_int_to_string.class # String
Example 2: rails comparar string to integer
val1 == val2.to_i
my_int = 69
my_int_to_string = my_int.to_s
puts my_int.class # Integer
puts my_int_to_string.class # String
val1 == val2.to_i