2019-01-30 16:14:15 +01:00
|
|
|
class Champs::RepetitionController < ApplicationController
|
|
|
|
before_action :authenticate_logged_user!
|
|
|
|
|
2022-05-03 16:40:09 +02:00
|
|
|
def add
|
2021-10-27 16:27:17 +02:00
|
|
|
@champ = policy_scope(Champ).includes(:champs).find(params[:champ_id])
|
2022-05-18 14:49:49 +02:00
|
|
|
@champs = @champ.add_row(@champ.dossier.revision)
|
2019-01-30 16:14:15 +01:00
|
|
|
end
|
2022-05-03 16:40:09 +02:00
|
|
|
|
|
|
|
def remove
|
2023-03-31 08:49:21 +02:00
|
|
|
@champ = policy_scope(Champ).includes(:champs).find(params[:champ_id])
|
|
|
|
@champ.champs.where(row_id: params[:row_id]).destroy_all
|
|
|
|
@champ.reload
|
2022-05-03 16:40:09 +02:00
|
|
|
@row_id = params[:row_id]
|
|
|
|
end
|
2019-01-30 16:14:15 +01:00
|
|
|
end
|