0
は私がのオブジェクトの配列をh've質問@questionsルビー/ RoRの - 連想配列に対してオブジェクトの配列をループ
---
- !ruby/object:Question
attributes:
id: "1"
answer: "2"
- !ruby/object:Question
attributes:
id: "7"
answer: "1"
- !ruby/object:Question
attributes:
id: "6"
answer: "4"
- !ruby/object:Question
attributes:
id: "4"
answer: "1"
と回答の配列は@answers
--- !map:ActiveSupport::HashWithIndifferentAccess
"1": "2"
"7": "3"
"6": "4"
"4": "0"
どのようにすることができますどのようなループメカニズムでも質問に対する回答を検証できますか?最初の質問のための唯一の答えが正しいか上記の例で
は、私は外に出--- !map:ActiveSupport::HashWithIndifferentAccess
"1": true
"7": false
"6": false
"4": false