更新出错

dev_daiao
daiao 5 years ago
parent 47722dd886
commit d97f76952c

@ -69,11 +69,10 @@ class HacksController < ApplicationController
# 新建
@hack.hack_sets.create!(hack_sets_params)
# 更新代码
hack_codes = @hack.hack_codes.new(hack_code_params)
if params[:hack_codes][:code] != @hack.code
hack_codes.modify_time = Time.now
hack_code_params = hack_code_params.merge(modify_time: Time.now)
end
hack_codes.save!
@hack.hack_codes.first.update_attributes!(hack_code_params)
end
render_ok
rescue Exception => e

Loading…
Cancel
Save