Story#118822101 - domains -> domain

This commit is contained in:
Vladimir Krylov 2016-06-27 12:09:27 +03:00
parent 58bdbb3f73
commit 8839110f10

View file

@ -3,18 +3,19 @@ xml.epp_head do
@errors.each do |x|
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
xml.value("xmlns:#{controller.controller_name}" => 'https://epp.tld.ee/schema/all-ee-1.0.xsd') do
xml.value("xmlns:#{model_name}" => "https://epp.tld.ee/schema/#{model_name}-eis-1.0.xsd") do
value = x[:value][:val]
attrs = {}
attrs["s"] = value if x[:value][:obj] == "status"
if (val = value).respond_to?(:each)
val.each do |el|
xml.tag!("#{controller.controller_name}:#{x[:value][:obj]}", el, attrs)
xml.tag!("#{model_name}:#{x[:value][:obj]}", el, attrs)
end
else
xml.tag!("#{controller.controller_name}:#{x[:value][:obj]}", val, attrs)
xml.tag!("#{model_name}:#{x[:value][:obj]}", val, attrs)
end
end if x[:value]