I have a hash with many values. For each of the values I want to generate a list entry.
When I do the following, only the last entry from the hash is displayed.
<% data.each do |k, v| %>
<li><%= v['name'] %> - <%= v['email'] %></li>
<% end %>
data is loaded from a YAML
person:
name: ABC
email: [email protected]
person:
name: LMN
email: [email protected]
How do I add all the values from hash in a html list? Thanks
Config. This shows up on most lists of Rails' reserved words, so it's probably a good idea to name your variable something else (use lowercase letters, also).