make heading_helper work with empty _short translation

This commit is contained in:
wvengen 2013-11-24 01:59:44 +01:00
parent e5471b9f73
commit 20bd86fe65

View file

@ -84,8 +84,8 @@ module ApplicationHelper
i18nopts = options.select {|a| !['short'].include?(a) }
s = model.human_attribute_name(attribute, i18nopts)
if options[:short]
sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({defaults: ''}))
s = raw "<abbr title='#{s}'>#{sshort}</abbr>" unless sshort.empty?
sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({fallback: true, default: ''}))
s = raw "<abbr title='#{s}'>#{sshort}</abbr>" unless sshort.blank?
end
s
end