Class: SolidCacheDashboard::CacheEventsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/solid_cache_dashboard/cache_events_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#dark_mode?

Instance Method Details

#indexObject



3
4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/solid_cache_dashboard/cache_events_controller.rb', line 3

def index
  events = SolidCacheDashboard::CacheEvent.order(created_at: :desc)
  
  # Filter by event type if specified
  if params[:event_type].present? && params[:event_type] != "all"
    events = events.where(event_type: params[:event_type])
  end
  
  @pagy, events = pagy(events, items: 25)
  @cache_events = SolidCacheDashboard.decorate(events)
end