# 编程内容 json.(@hack, :name, :description, :language, :difficult, :category, :time_limit, :open_or_not) # 代码 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