Class: Omnitrack::VisitEventsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Omnitrack::VisitEventsController
- Defined in:
- app/controllers/omnitrack/visit_events_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/omnitrack/visit_events_controller.rb', line 5 def index @page = [params.fetch(:page, 1).to_i, 1].max @per_page = Omnitrack.config.dashboard_per_page.to_i scoped = Omnitrack::VisitEvent.recent_first @total_count = scoped.count @total_pages = (@total_count.to_f / @per_page).ceil @events = scoped.includes(:delivery_statuses).offset((@page - 1) * @per_page).limit(@per_page) end |
#show ⇒ Object
15 16 17 |
# File 'app/controllers/omnitrack/visit_events_controller.rb', line 15 def show @event = Omnitrack::VisitEvent.includes(:delivery_statuses).find(params[:id]) end |