Pas de cache, pas assez utiles :)

This commit is contained in:
echarp 2014-08-16 23:35:22 +02:00
parent 8901183d12
commit b5fd79e4e0
2 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,3 @@
ActiveAdmin.register Region do
permit_params :name
after_update do
expire_fragment 'regions'
end
end

View File

@ -1,9 +1,8 @@
-# Seems necessary, for the time being, to ensure calendar is changing days correctly
- Time.zone = 'Paris'
- cache 'regions' do
= render '/regions/selector'
= render '/lugs/search'
= render '/regions/selector'
= render '/lugs/search'
- if params[:year]
-# Whole year calendar
@ -22,7 +21,8 @@
root_url(start_date: start_date), class: 'month_selector' } do |date, events|
.day_number= date.day
%ul.events
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }.sort_by { |e| e.city }.each do |event|
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }
- .sort_by { |e| e.city }.each do |event|
%li.event
= link_to event do
%strong.city= event.city.gsub '-', ' '
@ -40,7 +40,8 @@
{ param => (date_range.last + 1.day).beginning_of_month, tag: params[:tag], region: params[:region] } } do |date, events|
.day_number= date.day
%ul.events
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }.sort_by { |e| e.city }.each do |event|
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }
- .sort_by { |e| e.city }.each do |event|
%li.event
= link_to event do
%strong.city= event.city.gsub '-', ' '