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-04-28 15:06:40 +02:00
|
|
|
@champs = @champ.add_row
|
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])
|
|
|
|
champ.champs.where(id: params[:champ_ids]).destroy_all
|
|
|
|
@row_id = params[:row_id]
|
|
|
|
end
|
2019-01-30 16:14:15 +01:00
|
|
|
end
|