So I’m not able to get this to work. What am I doing wrong? I wasn’t able to get your syntax to work.
No matter what it just keeps submitting the default way:
no function clause matching Index.handle_event("alert", %{"_csrf_token" => "1223-456"}, Phoenix.LiveView.Socket...
Example:
<%= form_for :survey, "#", [phx_submit: "alert", employee_id: @current_employee.id, user_id: user.id], fn _f -> %>
....
def handle_event("alert", %{"survey" => params}, socket) do
...
It only allow a list of params inside square brackets, else error.
How can I make the params go through?