Hi all!
I’m having problems to understand how the assigns mapping works on components. I haven’t found anything here. I have a form defined at <name>_form.html.heex (as it is created with the generator phx.gen.context). Now I would like to add to this form a selector with options coming from another model, on the controller I copied the data to conn.assigns.categories but I can access the data using @categories on the form at <name>_form.html.heex, even though I can do it on the new.html.heex. Therefore I believe I have an issue with the “attrs” used to map variables to the form’s assigns. Any idea how this process works? I tried adding attr: :categories, :list also attr: :categories, :any and also on the controller with render(conn, :new, %{changeset: changeset, categories: conn.assigns.categories}) with no luck ![]()
How do I send a particular data from my controller to a component? Thanks!!






















