1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-10 21:24:20 +01:00
fab-manager/app/views/api/age_ranges/index.json.jbuilder

7 lines
175 B
Ruby

user_is_admin = (current_user and current_user.admin?)
json.array!(@age_ranges) do |ar|
json.extract! ar, :id, :name
json.related_to ar.events.count if user_is_admin
end