title: Ruby on Rails can't convert String into Integer
body: <p>I am sending JSON data to a controller which parses it. </p>
  
  <p><strong>ROR Code</strong></p>
  
  <pre><code>Class.where(challenge_id:challenge.id,song_id:song_hash['song_id']).first
  </code></pre>
  
  <p>The <strong>error</strong> is </p>
  
  <pre><code>can't convert String into Integer
  </code></pre>
  
  <p>I even change the <code>song_id:song_hash['song_id']</code> to <code>song_id:song_hash['song_id'].to_i</code> but it didn't work </p>
  
  <p>The <strong>Hash DATA</strong> is </p>
  
  <pre><code>{"session_token"=&gt;"Xt9toEzHI3bYXeJNkenyqg", "challenge"=&gt;{"challenge_id"=&gt;"15", "player_name"=&gt;"usman", "guessed_songs"=&gt;{"0"=&gt;{"song_id"=&gt;"10", "guessed"=&gt;"YES"}, "1"=&gt;{"song_id"=&gt;"11", "guessed"=&gt;"YES"}, "2"=&gt;{"song_id"=&gt;"12", "guessed"=&gt;"YES"}, "3"=&gt;{"song_id"=&gt;"13", "guessed"=&gt;"YES"}, "4"=&gt;{"song_id"=&gt;"15", "guessed"=&gt;"YES"}}, "player_status"=&gt;{"0"=&gt;{"coins"=&gt;"20", "points"=&gt;"0", "player_name"=&gt;"usman"}, "1"=&gt;{"coins"=&gt;"20", "points"=&gt;"0", "player_name"=&gt;"Usman"}}}}
  </code></pre>
  
  <p>Couldn't find what is not converting into integer </p>