新建关卡的问题

dev_hjm
daiao 6 years ago
parent 87aa6c8378
commit e9cab1b498

@ -18,7 +18,7 @@ class StagesController < ApplicationController
@stage.position = @subject.stages.count + 1
@stage.save!
unless params[:shixun_id].blank?
shixuns = Shixun.where(id: params[:shixun_id])
shixuns = Shixun.where(id: params[:shixun_id]).order("field(id, #{params[:shixun_id].join(",")})")
shixuns.each do |shixun|
StageShixun.create!(stage_id: @stage.id, subject_id: @subject.id, shixun_id: shixun.id, position: @stage.stage_shixuns.count + 1)
end

Loading…
Cancel
Save