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
|
|
|
|
champ = policy_scope(Champ).includes(:champs).find(params[:champ_id])
|
2022-12-16 15:07:26 +01:00
|
|
|
champ.champs.where(row_id: params[:row_id]).destroy_all
|
2022-05-03 16:40:09 +02:00
|
|
|
@row_id = params[:row_id]
|
|
|
|
end
|
2019-01-30 16:14:15 +01:00
|
|
|
end
|