First things first i'm using Psql, If that helps, Probably doesnt matter.
I have two tables, (they have the model has_many inbetween)
# models
RegUser(id, Email, Name)
Booking(id , Event_id, Reg_user_id)
How do i go about linking these two together so that when viewing event 40, The registered users for that event will show, Its basically joining two two tables together from the params passed through (i believe!!!)
Heres the code i had working in the past
@reg_usr = RegUser.where(event_id: params[:id])
We moved the event_id to another table and dropped it out of the reguser table.