11175
(-- --)
1
Hi. I'm trying to perform the following comparison
if (params[:bid][:points] <= session[:user][:points])
But I get the following error
"comparison of String with 0 failed"
I have tried changing the code to this
if (params[:bid][:points].to_i <= session[:user][:points])
But now I get
"too few arguments"
Can anyone see what's wrong? Surely this should be a pretty simple
thing?
Thanks
11175
(-- --)
2
Dan Smith wrote:
Hi. I'm trying to perform the following comparison
....
if (params[:bid][:points].to_i <= session[:user][:points])
But now I get
"too few arguments"
Can anyone see what's wrong? Surely this should be a pretty simple
thing?
Thanks
try a puts on params[:bid][:points] and session[:user][:points] to see
what it gives, because I guess that one of this 2 vars is nil?!