Attribute is added to error messages

This commit is contained in:
Priit Tark 2015-03-05 11:06:55 +02:00
parent fdac633f07
commit bca9ddef16
5 changed files with 72 additions and 61 deletions

View file

@ -103,6 +103,7 @@ class EppController < ApplicationController
el, missing = nil, nil
selectors.each do |selector|
full_selector = [@prefix, selector].compact.join(' ')
attr = selector.split('>').last.strip.underscore
el = params[:parsed_frame].css(full_selector).first
if allow_blank
@ -112,7 +113,7 @@ class EppController < ApplicationController
end
epp_errors << {
code: '2003',
msg: I18n.t('errors.messages.required_parameter_missing', key: full_selector)
msg: I18n.t('errors.messages.required_parameter_missing', key: "#{full_selector} [#{attr}]")
} if missing
end