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/hacks/edit.json.jbuilder

20 lines
485 B

5 years ago
# 编程内容
5 years ago
json.(@hack, :name, :description, :language, :difficult, :category, :time_limit, :open_or_not, :status, :sub_discipline_id)
# 课程
json.tag_discipline_id @hack.tag_discipline_containers.pluck(:tag_discipline_id)
5 years ago
# 代码
json.language @hack.language
json.code @hack.code
# 测试集
json.hack_sets do
json.array! @hack.hack_sets do |set|
json.(set, :id, :input, :output, :position)
end
end
json.user do
json.partial! 'users/user', user: current_user
end