Skip to content

add index to name attribute for nested models#36

Merged
michaelkhabarov merged 2 commits intocorp-gp:masterfrom
michaelkhabarov:child_index
Aug 14, 2025
Merged

add index to name attribute for nested models#36
michaelkhabarov merged 2 commits intocorp-gp:masterfrom
michaelkhabarov:child_index

Conversation

@michaelkhabarov
Copy link
Collaborator

Добавлен индекс для атрибута name и id у вложенных форм, из-за этого в параметрах теперь приходит не массив, а хеш вида { '0' => { url: 'https://omniplatform.ru' }, '1' => { url: 'https://google.com' } }, соответсвенно добавил поддержку такого варианта в BaseForm

Можно добавить опцию child_index как в action_view, чтобы управлять этим индексом, но пока вроде без надобности https://github.com/rails/rails/blob/b0c813bc7b61c71dd21ee3a6c6210f6d14030f71/actionview/lib/action_view/helpers/form_helper.rb#L2719

Пайплайн на gp зелёный

@michaelkhabarov michaelkhabarov merged commit 7381216 into corp-gp:master Aug 14, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant