lundi 7 septembre 2015

Regarding comparsion between two columns with same id

if session[:correct_answer] = session[:selected_answer]
    @result = +1
 else
    @result = -1
end

This code is I am using which gives always wrong output

That's the data between those variables from session

session[:correct_answer]
   <Question:0xb2ae47c0 id: 3, correct_answer: 1>

session[:selected_answer]
<Question:0xb2abb898 id: 3, selected_answer: 3>

It always give a true result but the fields are not same then why this result is coming

help me

Aucun commentaire:

Enregistrer un commentaire