demarches-normaliennes/app/controllers/champs/repetition_controller.rb

16 lines
456 B
Ruby
Raw Normal View History

2019-01-30 16:14:15 +01:00
class Champs::RepetitionController < ApplicationController
before_action :authenticate_logged_user!
def add
@champ = policy_scope(Champ).includes(:champs).find(params[:champ_id])
@champs = @champ.add_row(@champ.dossier.revision)
2019-01-30 16:14:15 +01:00
end
def remove
@champ = policy_scope(Champ).includes(:champs).find(params[:champ_id])
@champ.champs.where(row_id: params[:row_id]).destroy_all
@champ.reload
@row_id = params[:row_id]
end
2019-01-30 16:14:15 +01:00
end