Fewer queries for for Conference#show

Reduces SQL wait times by >90% on splash pages.
This commit is contained in:
James Mason 2017-11-17 19:34:26 -08:00
parent 29a640a267
commit 995176ffe5
11 changed files with 122 additions and 99 deletions

View file

@ -6,7 +6,7 @@
.row
.col-md-12.text-center
%h2 Booths
- @conference.booths.confirmed.each_slice(3).with_index do |slice, index_for_row|
- @conference.confirmed_booths.each_slice(3).with_index do |slice, index_for_row|
.row.row-centered
- slice.each.with_index do |booth, index_for_column|
.col-md-4.col-sm-4.col-xs-10.col-centered.col-top
@ -18,7 +18,7 @@
%h3.text-center
= booth.title
%p.text-center.text-muted
= link_to "#show_descrition_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do
= link_to "#show_description_#{index_for_row}_#{index_for_column}", "data-toggle"=>"collapse" do
learn more
.collapse{ id: "show_descrition_#{index_for_row}_#{index_for_column}" }
.collapse{ id: "show_description_#{index_for_row}_#{index_for_column}" }
= markdown(booth.description)