I have a custom SQL query that I run with this line:
@avg_score = "#{ActiveRecord::Base.connection.execute(@avg_score_SQL)}"
when that is run, @avg_score has a value of:
[{"score"=>8, 0=>8}]
the results are correct, but it prints it like that :-/ I just want it to print out the “8”
How do I get it to just print the value of score?
[{"score"=>8, 0=>8}]is just an array with one element, and that element is a hash. So you can access the score like this: