defmodule DeAboriginal.Data.Activity do
use Ecto.Schema
import Ecto.Changeset
alias DeAboriginal.Data.Language
schema "activities" do
field :name, :string
field :event_id, :id
has_many :languages, Language, foreign_key: :id
timestamps()
end
@doc false
def changeset(activity, attrs) do
activity
|> cast(attrs, [:name])
|> cast_assoc(:languages, with: &Language.changeset/2)
|> validate_required([:name])
end
end
Ah so the commenting out is just me testing things. But not visible means any text, tags, elements I put inside the inputs_for, when navigating to that page it doesn’t show.
Outside inputs_for however it works just fine.
EDIT:
Just to clarify, I tested using mix phx.server and inspected the HTML using the browser. Anything between the <%= inputs_for %> and <% end %> tags do not appear.
This is exactly my issue. It seems out of place that you’d have to manually “hack” it to do this. I’m not sure if they decided not to include this feature in because Elixir is known for being really fast and it’s because it doesn’t load anything unless you tell it. So it does make a little sense knowing this that we’d have to manually load and nested relationships because of their impact on global speed at a macro level.
but then again…in my case, it’s not like that for belongs_to relationships and instead just has_many relationships.