How to flag changes and load data from another table?

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!

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 M.
<[email protected]

sorry 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?

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 M.
<[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs