I'm looking into nested attributes and I have a few questions about relationships between models.
Say I have a Show that has_many Seasons. Both Show and Season can have many Actors and Staff. See table example:
When a Show is created, Season accepts the Show association and both Actors and Staff accept both the Show and Season attributes. Would this be a triple nested form?
So my models would look like this?
class Show < ApplicationRecord
has_many :seasons, dependent: :destroy
has_many :actors, dependent: :destroy
has_many :staff, dependent: :destroy
accepts_nested_attributes_for :seasons, allow_destroy: true
accepts_nested_attributes_for :actors, allow_destroy: true
accepts_nested_attributes_for :staff, allow_destroy: true
end
class Season < ApplicationRecord
belongs_to :show
has_many :actors, dependent: :destroy
has_many :staffs, dependent: :destroy
accepts_nested_attributes_for :actors, allow_destroy: true
accepts_nested_attributes_for :staff, allow_destroy: true
end
class Actor < ApplicationRecord
belongs_to :show
belongs_to :season
end
class Staff < ApplicationRecord
belongs_to :show
belongs_to :season
end
And my Show Controller would look like:
class ShowsController < ApplicationController
def create
@show.seasons.build
@show.seasons.build.actors.build
@show.seasons.build.staffs.build
end
end

Actorhas many showsandhas many seasons. The same forStaff. But above the schema you wrote:Both Show and Season can have many Actors and Staff