I have an object like so
[
{"name": "ryan",
"age": "12",
},
]
And code in my erb file like so:
<div>
<% @list.each do |student| %>
<%= student.each do |k,v|%>
<%=v%>
<% end %>
<% end %>
</div>
I would assume that only the value of the hash in the list would be what gets rendered, so just ryan and 12 being rendered in the template. However in the template, the values in the hash plus the whole list end up getting rendered, so something like
ryan, 12 {"name": "ryan", "age": "12", },
end up getting rendered. Im not sure why cause in the double for loop, I only have the v variable that I want rendered, not sure where the rest of the object is coming from. Am I missing something about how erb files work?