1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/views/api/events/index.json.jbuilder
2023-02-15 16:30:47 +01:00

11 lines
328 B
Ruby

# frozen_string_literal: true
total = @events.except(:offset, :limit, :order).count
json.array!(@events) do |event|
json.partial! 'api/events/event', event: event
json.event_image_small "#{event.event_image.attachment.small.url}?#{event.event_image.updated_at.to_i}" if event.event_image
json.nb_total_events total
end