hasyrails / calendar-vue-original

0 stars 0 forks source link

88_schedule_done_status / ガントチャートに追加した予定の完了機能を実装する #173

Closed hasyrails closed 3 years ago

hasyrails commented 3 years ago
hasyrails commented 3 years ago

ありがち

更新できない

def done
    @schedules = Schedule.where(card_id: @schedule.card_id)
    if @schedules.present?
      @schedules.each do |schedule|
        schedule.done = true
      end
    end
  end

更新成功

def done
    @schedules = Schedule.where(card_id: @schedule.card_id)
    if @schedules.present?
      @schedules.each do |schedule|
        schedule.update(done: 'true')
      end
    end
  end
hasyrails commented 3 years ago

完了状態の予定をガントチャートに残す場合の表示スタイル