diff --git a/app/views/i18n/_recursive.haml b/app/views/i18n/_recursive.haml index 410760d..6c99250 100644 --- a/app/views/i18n/_recursive.haml +++ b/app/views/i18n/_recursive.haml @@ -4,5 +4,5 @@ = render 'i18n/text_field', keys: keys, value: value - elsif value.is_a? Hash = render 'i18n/recursive', data: value, superkeys: keys - -# elsif value.is_a? Array - = render 'i18n/recursive_array', data: value + - elsif value.is_a? Array + = render 'i18n/recursive_array', data: value, superkeys: keys diff --git a/app/views/i18n/_recursive_array.haml b/app/views/i18n/_recursive_array.haml index 6f0d141..7db0e36 100644 --- a/app/views/i18n/_recursive_array.haml +++ b/app/views/i18n/_recursive_array.haml @@ -1,7 +1,8 @@ -- data.each do |value| +- data.each_with_index do |value, i| + - keys = [superkeys, i].flatten - if value.is_a? String - = render 'i18n/text_field', value: value, key: "#{key}[]" + = render 'i18n/text_field', keys: keys, value: value - elsif value.is_a? Hash - = render 'i18n/recursive', data: value + = render 'i18n/recursive', data: value, superkeys: keys - elsif value.is_a? Array - = render 'i18n/recursive_array', data: value + = render 'i18n/recursive_array', data: value, superkeys: keys