New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate ID #1192
Comments
See the "Namespaced forms all multiple Formtastic forms to exist on the one page without DOM id clashes and invalid HTML documents." in the documentation of That should solve your problem. |
@mikz thank's for your reply, i placed the namespace and did not solve. |
@dcalixto you can still pass semantic_form_for(@user, html: { id: 'prefixed_form' }) |
thank you very much @mikz , and unintentionally abuse, the same probem seems to appear on submit: i've tried the same logic but seems not solve. Duplicate ID "user_submit_action"
|
@dcalixto could you post the generated html ? It is weird, that |
@dcalixto I check the source and the tests and I don't see any possibility why It would help us a lot. To improve documentation, we need to learn how people use it and what mistakes they make. |
I too am experiencing the same problem with the Using the plain old Rails form builder: = form_for(@animal, namespace: 'cat', url: zookeeper_animal_path) do |f| gets me: <form id="cat_edit_zoo_animal_249" class="edit_zoo_animal" method="post" accept-charset="UTF-8" action="/zookeeper/animals/249"> whereas using Formtastic: = semantic_form_for(@animal, namespace: 'cat', url: zookeeper_animal_path) do |f| gets me: <form id="edit_zoo_animal_249" class="formtastic zoo_animal" method="post" accept-charset="UTF-8" action="/zookeeper/animals/249" novalidate="novalidate"> So the Note that in this example, the ActiveRecord model is |
Wow, thanks for the quick response @mikz ! For now that the issue is documented at least. |
I'm experiencing the same problem with duplicate ids on the submit buttons and forms. I think this is happening because the @mikz Do you know if there's a reason it was remapped like this? |
I made #1065 to fix #904. It was doing nasty stuff and changing class variables when rendering forms. It is possible I did not fully understand the implications and it has a bug that prevents using the |
@justinfrench #1212 doesn't seem to be merged yet; did some other fix solve this bug? |
@fredngo I closed this as part of a mass clean-up. If you have the time to pull all this together in one PR, I'd really appreciate the help, as I don't have the time to maintain this like I used to. |
On a user edit page i have several forms using formstatic but formstatic is duplicating the ids, i would like to know if have a way to change this issue. here a exemple:
<form accept-charset="UTF-8" action="/users/test" class="formtastic user" id="edit_user_1" method="post" novalidate="novalidate">
the edit_user_1 is duplicating on the others forms.
thank's
The text was updated successfully, but these errors were encountered: