Last active
August 5, 2020 21:02
-
-
Save BenSchZA/cbff61e6002b13caf40dfcb9cc311283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= f = form_for :select_user_type, "#", [phx_change: :select_user_type, phx_value_id: creds.id, class: "ui form"] %> | |
<%= select(f, :role, ["Admin": "admin", "User": "user"]) %> | |
</form> | |
def handle_event("select_user_type", %{"select_user_type" => %{"role" => role}}, socket) do | |
IO.inspect socket.assigns | |
{:noreply, socket} | |
end | |
<form action="#" class="ui form" method="post" phx-change="select_user_type" phx-value-id="1"> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment