6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/activeadmin-mongoid-localize/attributes_table.rb', line 6
def row(attr, &block)
_locales = ActiveAdmin::Mongoid::Localize.locales
_locales.each_with_index do |locale, index|
@table << tr do
if index == 0
th :rowspan => _locales.length do
(attr)
end
end
td do
I18n.with_locale locale do
(
image_tag("aml/flags/#{locale.to_s}.png", alt: locale.to_s, title: locale.to_s) +
' ' +
content_for(block || attr)
).html_safe
end
end
end
end
end
|