demarches-normaliennes/app/controllers/champs/options_controller.rb
2023-04-03 16:54:50 +02:00

9 lines
315 B
Ruby

class Champs::OptionsController < ApplicationController
before_action :authenticate_logged_user!
def remove
@champ = policy_scope(Champ).includes(:champs).find(params[:champ_id])
@next_checkbox_id = @champ.next_checkbox_id(params[:option])
@champ.remove_option([params[:option]].compact)
end
end