refacto: better error management

This commit is contained in:
sebastiencarceles 2023-01-14 11:53:55 +01:00
parent e89c8385a4
commit 39545671f3
7 changed files with 51 additions and 33 deletions

View file

@ -3,7 +3,6 @@ class Champs::RNAController < ApplicationController
def show
@champ = policy_scope(Champ).find(params[:champ_id])
@rna = read_param_value(@champ.input_name, 'value')
@network_error = @champ.fetch_association!(@rna).present?
@error = @champ.association_fetch_error_key unless @champ.fetch_association!(read_param_value(@champ.input_name, 'value'))
end
end