I’m still wading through Rails, picking up as much as I can.
I have the following associations set up:
Outlet **has_many** Monitorings
Monitoring **belongs_to** Outlets
If I was in a dashboard_controller.rb, and I had the following loop:
@revoked_outlet = Outlet.where(:revoked => true)
And then in the view, I’m looping through each outlet.
However, in the same loop I want to grab the most recent monitoring where :was_revoked => true.
How would I do this according to conventions?
In your view, try this:
Good luck