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

14 lines
396 B
Plaintext
Raw Normal View History

2016-06-21 17:02:44 +02:00
role = (current_user and current_user.is_admin?) ? 'admin' : 'user'
2016-03-23 18:39:41 +01:00
2016-06-21 17:02:44 +02:00
json.cache! [@trainings, role] do
json.array!(@trainings) do |training|
json.id training.id
json.name training.name
json.description training.description
json.machine_ids training.machine_ids
json.nb_total_places training.nb_total_places
json.plan_ids training.plan_ids if role === 'admin'
end
2016-03-23 18:39:41 +01:00
end