Submission form review of Ajax in Rails. How to clean after shipping if multiple forms?
On the page there are several items to each have a comment form and send comments.
How to make the form after sending a comment via Ajax again became empty.
This option only works for the first form: $("#comment_content").val(");
For each shape needs its own unique id, but how to do it?
You can specify unique id for div of the form, id type="comments_form_<%= item.id % > but the above method only works for forms but not for div.
Maybe there are other options?
It will be rendered under each item has id="comment_content" - Mandy_Swaniaws commented on July 9th 19 at 13:35
In a correctly written HTML document MUST NOT BE elements with the same ID. It is therefore an ID that is the unique identifier of the element in the Dom structure. - lily.Kozey commented on July 9th 19 at 13:38
Please sign in or sign up to write your answer or comment.
It will be rendered under each item has id="comment_content" - Mandy_Swaniaws commented on July 9th 19 at 13:35