خرید بک لینک

Vote count: 0

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

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 15 فروردين 1395 ساعت: 0:19

صفحه بندی