I have generated the default live view using
mix phx.gen.live
I added a button in the form_component.html.heex
with a phx-click
attribute,
When I define handle_event/3
inside the FormComponent
module I get the error no function clause matching
but when I define handle_event/3
inside the Index
module it works β¦
I want to handle_event
inside the FormComponent
module because it contains the changeset
from the user input, and I can not access the changeset from the Index
module.
the router.ex
file also contains the default value:
live "/items/new", ItemLive.Index, :new