Hi, i have a course table, programme table and a degree table. The user has to create courses and programmes and when they add courses to programmes, it will be stored in the degree table. I have four fields from Course Table. - Pre-requisite - Excluded-Combination - Grouping - Remark I have these exact same fields in the Degree Table. When a user adds a course to a programme, I want to be able to retrieve the value of the four fields that are already stored in the course table. (depending on what course they choose to add to programme) ------------------------------ eg. (Course table) Record 1: course_id: cou568 Pre-requisite: ab Excluded-Combination: cd Grouping: ef Remark: hi ------------------------------ how do i make it so that the user will be able to see the values in the add course to programme form? (something like editing) ------------------------------ eg. when user decides to add cou568 to a programme, the app will retrieve the pre-req, etc from cou568 records and display it in the form (Degree table) Record 1: Pre-requisite: ab, 12* Excluded-Combination: cd Grouping: ef, 145* Remark: hi, 155* ------------------------------ * denoting that the user has added these new values also, if the users adds on to the values, how do i add a symbol/or something to show that the value has been changed? (like you see above) i heard that this might be possible using ajax or a continuation form, but i have no idea how to go about it... sorry if this is so lengthy, i tried to explain as simply as possible thanks in advance! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Having same fields in two tables indicate code smell. Find the concept that is represented by those attributes and create a new model for it. Then use composed of macro in ur other two classes. Sent from my iPhone On Dec 12, 2007, at 10:42 PM, Jojo Mojo <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > wrote:> > Hi, > > i have a course table, programme table and a degree table. > > The user has to create courses and programmes > and when they add courses to programmes, it will be stored in the > degree > table. > > I have four fields from Course Table. > - Pre-requisite > - Excluded-Combination > - Grouping > - Remark > > I have these exact same fields in the Degree Table. > > When a user adds a course to a programme, I want to be able to > retrieve > the value of the four fields that are already stored in the course > table. (depending on what course they choose to add to programme) > > ------------------------------ > eg. > > (Course table) Record 1: > course_id: cou568 > Pre-requisite: ab > Excluded-Combination: cd > Grouping: ef > Remark: hi > > ------------------------------ > > how do i make it so that the user will be able to see the values in > the > add course to programme form? > > (something like editing) > > ------------------------------ > eg. when user decides to add cou568 to a programme, the app will > retrieve the pre-req, etc from cou568 records and display it in the > form > > (Degree table) Record 1: > Pre-requisite: ab, 12* > Excluded-Combination: cd > Grouping: ef, 145* > Remark: hi, 155* > > ------------------------------ > > * denoting that the user has added these new values > > also, if the users adds on to the values, how do i add a symbol/or > something to show that the value has been changed? (like you see > above) > > > i heard that this might be possible using ajax or a continuation form, > but i have no idea how to go about it... > > sorry if this is so lengthy, i tried to explain as simply as possible > thanks in advance! > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bcp wrote:> Having same fields in two tables indicate code smell. Find the concept > that is represented by those attributes and create a new model for it. > Then use composed of macro in ur other two classes. > > Sent from my iPhone > > On Dec 12, 2007, at 10:42 PM, Jojo Mojo > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.orgsorry i''m not very good at ruby on rails, and i don''t know what you mean here, could u maybe direct me to a website that guides me on how to do this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---