So I have this following request:
{"utf8"=>"✓",
"student_work"=>{"work_experiences_attributes"=>{"1415498778636"=>{"company_name"=>"Company1",
"start_year"=>"2014",
"end_year"=>"2014",
"job_title"=>"Title1",
"job_description"=>"test1"},
"1415498795509"=>{"company_name"=>"Company2",
"start_year"=>"2014",
"end_year"=>"2014",
"job_title"=>"Title2",
"job_description"=>"Test2"}}},
"commit"=>"Next"}
or to make it easier:
student_work[work_experiences_attributes][1415498778636][company_name]:Company1
student_work[work_experiences_attributes][1415498778636][start_year]:1
student_work[work_experiences_attributes][1415498778636][start_year]:2014
student_work[work_experiences_attributes][1415498778636][end_year]:2
student_work[work_experiences_attributes][1415498778636][end_year]:2014
student_work[work_experiences_attributes][1415498778636][job_title]:Title1
student_work[work_experiences_attributes][1415498778636][job_description]:test1
student_work[work_experiences_attributes][1415498795509][company_name]:Company2
student_work[work_experiences_attributes][1415498795509][start_year]:3
student_work[work_experiences_attributes][1415498795509][start_year]:2014
student_work[work_experiences_attributes][1415498795509][end_year]:4
student_work[work_experiences_attributes][1415498795509][end_year]:2014
student_work[work_experiences_attributes][1415498795509][job_title]:Title2
student_work[work_experiences_attributes][1415498795509][job_description]:Test2
How do I access each values using the each loop in Ruby? I am still new to Ruby, please help. Thanks
Update Those number (1415498778636 and 1415498795509) is always changing, so the loop must be able to handle any different kind of numbers