Reputation: 101
I have a hash, which contains information like this
{"Bananas"=>2, "Apples"=>3}
This hash regularly updates, such as when a new fruit gets added and clicked on. The number is the number of times it is clicked on.
I want to display a table which basically shows the name and the number of clicks
Something like this
@hash.each do |hash|
%tr
%th hash.fruit_name
%th hash.clicks
Now I don't have access to .fruit_name and .clicks, which is why I'm not doing it like that, but I want the same result but from the hash
is this possible?
Upvotes: 0
Views: 214