I have a form that always submits the form of the "update" function in the controller, and I created this form using the "remote_form_for" tag. In this form, I have objects from different tables, and from this form I want to transfer all the form data to another function (and not to the "update" function) using an AJAX request.
I tried many methods, including using the submit tag with an action
<% remote_form_for @employee, :url => organization_employee_path(@organization, @employee), :method => :put do |employee_form| %> // form objects and other functionalities .... .... // views inside the forms <div id="employee_header_div"> <%= render :partial => "employee_header", :locals => {:employee => @employee} %> </div> ... ... <%= submit_tag "page_level_validation", :id => "page_level_validation" , :action=>"validate"%> <% end %>
But an Ajax request always calls the same "update" function.
It would be very helpful if anyone could help solve this problem.
source share