orbit-basic/app/helpers/panel/user_helper.rb

13 lines
303 B
Ruby
Raw Normal View History

2011-11-12 09:54:45 +00:00
module Panel::UserHelper
def show_user_attribute(object, key, locale = '')
attribute = object.attribute_values.detect {|av| av.key.to_s.eql?(key.to_s) || av[locale.to_s].eql?(locale.to_s) }
if locale.to_s.blank?
attribute['key']
else
attribute[locale.to_s]
end
end
end