Display variable from a relationship

Hello,

I have the following scenario:

Models:

provider (has_and_belongs_to_many)
level (has_and_belongs_to_many)
levels_providers

At the moment, I’m attempting a page that will list all of the
providers. I have this working perfectly, but I want each provider that
is listed to also list the levels that are associated with it. I haven’t
been able to get my head around this. I can provide more information,
but I’m not sure where to go at this point. Thanks for any help!

Jonathan

Assuming the models are set up correctly each provider object can
access it’s levels in something similar to:

for level in provider.levels do
#stuff
end

provider.levels should give you every level associated with that
provider.

Similarly, level.providers will give you all the providers associated
with any given leve.

On Oct 9, 7:36 pm, Jonathan S. [email protected]

Perfect. Thanks for your help.

[email protected] wrote:

Assuming the models are set up correctly each provider object can
access it’s levels in something similar to:

for level in provider.levels do
#stuff
end

provider.levels should give you every level associated with that
provider.

Similarly, level.providers will give you all the providers associated
with any given leve.

On Oct 9, 7:36 pm, Jonathan S. [email protected]