Skip to content

Commit e1b0429

Browse files
committed
Fix translated_inputs not properly setting up user block capture (#4)
1 parent 6cd5174 commit e1b0429

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/active_admin/globalize/form_builder_extension.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ def translated_inputs(name = "Translations", options = {}, &block)
88
available_locales = options.fetch(:available_locales, I18n.available_locales)
99
switch_locale = options.fetch(:switch_locale, false)
1010
default_locale = options.fetch(:default_locale, I18n.default_locale)
11+
if block_given?
12+
# If this translated_inputs is nested inside an inputs, AA has already set this
13+
template.assigns[:has_many_block] = true
14+
end
1115
template.content_tag(:div, class: "activeadmin-translations") do
1216
template.content_tag(:ul, class: "available-locales") do
1317
available_locales.map do |locale|

0 commit comments

Comments
 (0)