Hi, I am a newbie to ROR and ActiveScaffold, below please find my DB schema and the issue that I am seeing with relationship Table Userviews ----------------------- userview_id (Prim Key) drama_id - belongs to table Drama venue_id - belongs to table Venue Table Dramas (has many showtimes) ----------------------- drama_id (Prim Key) drama_name . . . Table Venues (has many showtimes) ----------------------- venue_id (Prim Key) venue_name . . . Table Showtimes ----------------------- show_id (Prim Key) show_date drama_id drama_id - belongs to table Drama venue_id - belongs to table Venue The link between Drama & Showtime, Venue & Showtime, Userview & Venue, Userview & Drama are working fine. The userview table is the one which define which showtimes can be accessed by a user. I am having trouble defining the relationship between Userviews & Showtimes - can anyone check this and let me know how should these two models be linked such that I can add a nested link from Userview record to Showtimes based on the drama_id and venue_id for each record. Thanks Ram --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Ram Take a look at activescaffold. There are some excellent examples on their homepage which will be of help to you. On Oct 1, 3:23 pm, Ram <visit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > I am a newbie to ROR and ActiveScaffold, below please find my DB > schema and the issue that I am seeing with relationship > > Table Userviews > ----------------------- > userview_id (Prim Key) > drama_id - belongs to table Drama > venue_id - belongs to table Venue > > Table Dramas (has many showtimes) > ----------------------- > drama_id (Prim Key) > drama_name > . > . > . > > Table Venues (has many showtimes) > ----------------------- > venue_id (Prim Key) > venue_name > . > . > . > > Table Showtimes > ----------------------- > show_id (Prim Key) > show_date > drama_id > drama_id - belongs to table Drama > venue_id - belongs to table Venue > > The link between Drama & Showtime, Venue & Showtime, Userview & Venue, > Userview & Drama are working fine. The userview table is the one which > define which showtimes can be accessed by a user. > > I am having trouble defining the relationship between Userviews & > Showtimes - can anyone check this and let me know how should these two > models be linked such that I can add a nested link from Userview > record to Showtimes based on the drama_id and venue_id for each > record. > > Thanks > Ram--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ram wrote:> Hi, > I am a newbie to ROR and ActiveScaffold, below please find my DB > schema and the issue that I am seeing with relationship > > Table Userviews > ----------------------- > userview_id (Prim Key) > drama_id - belongs to table Drama > venue_id - belongs to table Venue > > > Table Dramas (has many showtimes) > ----------------------- > drama_id (Prim Key) > drama_name > . > . > . > > Table Venues (has many showtimes) > ----------------------- > venue_id (Prim Key) > venue_name > . > . > . > > > Table Showtimes > ----------------------- > show_id (Prim Key) > show_date > drama_id > drama_id - belongs to table Drama > venue_id - belongs to table Venue > > The link between Drama & Showtime, Venue & Showtime, Userview & Venue, > Userview & Drama are working fine. The userview table is the one which > define which showtimes can be accessed by a user. > > I am having trouble defining the relationship between Userviews & > Showtimes - can anyone check this and let me know how should these two > models be linked such that I can add a nested link from Userview > record to Showtimes based on the drama_id and venue_id for each > record. > > Thanks > RamWhy is usersviews linked to drama_id and venue_id instead of just show_id? -- Michael Wang --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---