You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/courses/get_historical_courses.json...

14 lines
380 B

json.courses do
json.array! @courses do |course|
if course.course_groups.present?
course.course_groups.each do |course_group|
json.name course.name + "-" + course_group.name
json.course_id course.id
json.course_group_id course_group.id
end
else
json.name course.name
json.course_id course.id
end
end
end