Hi,
When I do view source of the page I am having two forms as shown
below
//comes from different partial
form_tag action=“show” id=“show_form” do
end
//comes from different partial
form_tag delete_path id=“delete_form” do
100.times do|i|
<%=checkbox_tag :user_id , :value => user_ids[i]%>
end
In the delete_form when I select checkboxes and click on submit button I
will delete the selected user ids.
The same form I am using for sending emails to selected users when
clicking on Send button.
Trough jQuery when click on Send Button I am changing the form
attributes
var form = $(‘delete_form’)
form.setAttribute(“action”, “/users/send_email”)
var hidden_fields = $(“input[name= _method”])
hidden_fields[1].val(“post”)
//If hidden_fields[1].val(“post”) is not done then the _method value
will be “delete” and delete action is called through rails routes
form.submit
Currently the above code works perfect. But later if the third form is
added above show_form then the above logic fails.
How should I access _method element of delete_form.