Changes for helpers, not including all by default
This commit is contained in:
1 parent
a0103d55c4
commit
189fa553c5
17 files changed
+13
-72
No files matched your search
@@ -0,0 +1,16 @@
|
||||
module Admin::UsersHelper
|
||||
|
||||
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
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user