Hi, I am a newbie in RoR, really newbie, I have followed some of the
tutorials, and now it is time for me to start one of my own.
To simplify the set-up, I have a client that has let us say a
pharmacy, the problem boils down to having three tables, BRAND, ACTIVE
INGREDIENT, and MEDICAL CONDITION. These three table are related to
each other. A brand can have many products each having only one active
ingredient, but each active ingredient treats different medical
conditions. (the example is not quite exact, because why should a
brand carry more than one medicine with the same active ingredient,
but just follow me for the sake of the example).
I want to have in one view three pulldown menus one for BRAND, one for
ACTIVE INGREDIENT, and one for MEDICAL CONDITION.
When someone opens this view, all the three pulldowns are initialized
to a default value. The ideas is the following as soon as one of the
pulldowns is changed from its default value the possible list of
options of the other two pulldown menus get constrained by the
relationship between the three tables.
If one chooses brand WD, then maybe this brand do not carry all
potential active ingredients, therefore it does not treat all
potential medical condition.
If one chooses a medican condition, maybe brand PX does not have a
medicine that treats that condition.
How do I do this?
I need help!!!
Heberto del Rio