Check out example codes for "iterate through values of an object rails". It will help you in understanding the concepts better.

Code Example 1

@work_profile.attributes.each do |attr_name, attr_value|
  ...
end

Learn ReactJs, React Native from akashmittal.com