display variable from a relationship

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.