Reputation: 137
When I do:
params[:page] * 10
It gives me 1111111111. I want it to return 10.
What am I doing wrong?
Upvotes: 1
Views: 97
Reputation: 29880
String multiplication will repeat the string n times. params
is always an array of strings in Rails, so you need to convert params[:page]
to an integer first with to_i
.
Upvotes: 3