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

7 lines
193 B
Plaintext
Raw Normal View History

user_is_admin = (current_user and current_user.admin?)
2016-06-30 09:34:26 +02:00
2015-05-05 03:10:25 +02:00
json.array!(@categories) do |category|
json.extract! category, :id, :name
2016-06-30 09:34:26 +02:00
json.related_to category.events.count if user_is_admin
2015-05-05 03:10:25 +02:00
end