Class: InnerPerformance::EventsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- InnerPerformance::EventsController
- Includes:
- Pagy::Backend
- Defined in:
- app/controllers/inner_performance/events_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
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 |
#show ⇒ Object
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 |