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/shixuns/_right.json.jbuilder

24 lines
556 B

6 years ago
# 实训创建者信息
json.creator do
json.partial! 'users/user', locals: { user: shixun.owner }
end
# 推荐实训
json.recommands do
json.partial! 'shap_shixun', locals: { shixuns: recommend_shixun(shixun) }
end
# 相关路径
json.paths do
json.partial! 'subjects/subject', locals: {subjects: relation_path(shixun)}
end
# 技能标签
user_tags = shixun.user_tags_name(User.current)
json.tags do
json.array! shixun.challenge_tags_name do |tag|
json.tag_name tag
json.status user_tags.include?(tag)
end
end