The below example shows redundancy as the database is queried twice for exactly the same thing. Is there anyway I can simplify this?
.div1
- towns.each do |town|
= town.name
- town.residents.where(:age => 14).each do |f|
%p= f.name
.div2
- towns.each do |town|
= town.name
- town.residents.where(:age => 14).each do |f|
%p= f.name
