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/ecs/index.json.jbuilder

35 lines
956 B

6 years ago
json.school_managers do
json.array! @school_managers do |u|
json.user_id u.id
json.user_name u.real_name
json.user_avatar_path url_to_avatar(u)
end
end
json.user_permission do
json.user_permission @user_permission
end
json.count @obj_count
json.school_majors do
json.template_major do
json.major_id @template_major.id #major_school 的id
json.major_index 0 #序号
json.major_code @template_major.ec_major.code
json.major_name @template_major.ec_major.name
end
json.real_major do
json.array! @major_schools.each_with_index.to_a do |m, index|
ec_major = m.ec_major #专业
json.major_id m.id
json.major_index (index+1) #序号
json.major_code ec_major.code
json.major_name ec_major.name
json.major_managers do
json.array! m.users.each do |u|
json.major_user u.real_name
end
end
end
end
end