Class: InnerPerformance::EventsController

Inherits:
ApplicationController show all
Includes:
Pagy::Backend
Defined in:
app/controllers/inner_performance/events_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
11
# File 'app/controllers/inner_performance/events_controller.rb', line 7

def index
  @q = InnerPerformance::Event.all.ransack(params[:q])
  @q.sorts = "created_at desc" if @q.sorts.empty?
  @pagy, @events = pagy(@q.result)
end

#showObject



13
14
15
16
# File 'app/controllers/inner_performance/events_controller.rb', line 13

def show
  @event = InnerPerformance::Event.find(params[:id])
  @traces = @event.traces.order(created_at: :asc)
end