Use errors as first-class objects

This commit is contained in:
Alex Sherman 2021-05-04 13:44:11 +05:00
parent 72c865e656
commit d4775ba5c5
8 changed files with 146 additions and 186 deletions

View file

@ -1,6 +1,8 @@
xml.epp_head do
xml.response do
@errors.each do |x|
@errors.each do |error|
x = error&.options
next if x.empty?
xml.result('code' => x[:code]) do
xml.msg(x[:msg], 'lang' => 'en')
model_name = resource ? resource.model_name.singular.sub('epp_','') : controller.controller_name.singularize