diff --git a/app/views/posts/_htmx_form.haml b/app/views/posts/_htmx_form.haml index a16e68dd..acb5585e 100644 --- a/app/views/posts/_htmx_form.haml +++ b/app/views/posts/_htmx_form.haml @@ -13,7 +13,7 @@ end options = { - id: base, + id: params.require(:form), multipart: true, class: 'form post ', 'hx-swap': params.require(:swap), diff --git a/app/views/posts/attributes/_new_has_many.haml b/app/views/posts/attributes/_new_has_many.haml index a5d62a84..54eb8d40 100644 --- a/app/views/posts/attributes/_new_has_many.haml +++ b/app/views/posts/attributes/_new_has_many.haml @@ -86,6 +86,7 @@ %input{ type: 'hidden', name: 'swap', value: 'beforeend' } %input{ type: 'hidden', name: 'base', value: id } %input{ type: 'hidden', name: 'name', value: name } + %input{ type: 'hidden', name: 'form', value: form_id } - if metadata.inverse? %input{ type: 'hidden', name: 'inverse', value: metadata.inverse } %div{ id: post_modal_id, data: { controller: 'modal' } } @@ -93,4 +94,4 @@ - content_for :"#{post_id}_body" do %div{ id: post_form_loaded_id } - content_for :"#{post_id}_footer" do - = render 'bootstrap/btn', form: id, content: t('.save'), type: 'submit' + = render 'bootstrap/btn', form: form_id, content: t('.save'), type: 'submit'