diff --git a/app/views/posts/attributes/_new_array.haml b/app/views/posts/attributes/_new_array.haml index 394345a6..692a6898 100644 --- a/app/views/posts/attributes/_new_array.haml +++ b/app/views/posts/attributes/_new_array.haml @@ -1,7 +1,7 @@ -# Genera un listado de checkboxes entre los que se puede elegir para guardar :ruby - id = "#{base}_#{attribute}" + id = "#{base.gsub(/[\[\]]/, '_')}_#{attribute}".squeeze('_') name = "#{base}[#{attribute}][]" form_id = "form-#{Nanoid.generate}" diff --git a/app/views/posts/attributes/_new_has_many.haml b/app/views/posts/attributes/_new_has_many.haml index 16d68322..48230759 100644 --- a/app/views/posts/attributes/_new_has_many.haml +++ b/app/views/posts/attributes/_new_has_many.haml @@ -8,7 +8,7 @@ del formulario principal porque no se pueden anidar. :ruby - id = "#{base}_#{attribute}" + id = "#{base.gsub(/[\[\]]/, '_')}_#{attribute}".squeeze('_') name = "#{base}[#{attribute}][]" form_id = "form-#{Nanoid.generate}" modal_id = "modal-#{Nanoid.generate}" diff --git a/app/views/posts/attributes/_new_predefined_array.haml b/app/views/posts/attributes/_new_predefined_array.haml index 5203c12b..218a2cc2 100644 --- a/app/views/posts/attributes/_new_predefined_array.haml +++ b/app/views/posts/attributes/_new_predefined_array.haml @@ -3,7 +3,8 @@ guardar, pero no se pueden agregar nuevos. :ruby - id = "#{base}_#{attribute}" + # @todo Convertir en un helper + id = "#{base.gsub(/[\[\]]/, '_')}_#{attribute}".squeeze('_') name = "#{base}[#{attribute}][]" form_id = "form-#{Nanoid.generate}"