Orbit/app/helpers/admin/users_helper.rb

17 lines
378 B
Ruby
Raw Normal View History

module Admin::UsersHelper
2011-11-12 09:54:45 +00:00
2011-12-23 10:34:21 +00:00
def show_attribute(object, field_id, locale = '')
attribute = object.attribute_values.detect {|av| av.attribute_field_id.eql?(field_id) || av[locale.to_s].eql?(locale.to_s) } rescue nil
if attribute
if locale.to_s.blank?
attribute['key']
else
attribute[locale.to_s]
end
2011-11-12 09:54:45 +00:00
else
''
2011-11-12 09:54:45 +00:00
end
end
end