Fix bug: users can now be saved

This commit is contained in:
chris2tof committed 2011-11-12 17:54:45 +08:00
1 parent 0a6efeb0a2
commit d9d7099da6
7 files changed
+26 -18

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
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