Optimised region filter, to minimise db requests
This commit is contained in:
parent
98e803899c
commit
1bdd9f434f
@ -18,10 +18,11 @@
|
|||||||
= filter_region.name
|
= filter_region.name
|
||||||
- if session[:region] == filter_region.id
|
- if session[:region] == filter_region.id
|
||||||
%em.fa.fa-times
|
%em.fa.fa-times
|
||||||
- elsif filter_region.regions.present?
|
- elsif !filter_region.region && filter_region.regions.present?
|
||||||
%small
|
%small
|
||||||
%em.fa.fa-chevron-down
|
%em.fa.fa-chevron-down
|
||||||
|
|
||||||
%ul
|
- unless filter_region.region
|
||||||
= render partial: '/regions/filter_region',
|
%ul
|
||||||
collection: filter_region.regions
|
= render partial: '/regions/filter_region',
|
||||||
|
collection: filter_region.regions
|
||||||
|
Loading…
Reference in New Issue
Block a user