I have the following tables:
Services
ID| Service_type_id| desc| date|payment_terms
Service_types
ID|NAME|isCredit
Payment_Terms
ID|Payment_Term
The services table contains a list of services. The service type defines the kind of service offered. Some service_types are offered on credit - the isCredit field holds a boolean 1 or 0 value. The thing is that when a user adds a service - I have a combo box populated with the service types. However what I need is that when the user chooses a service type whose isCredit value is 1, it should show on the same form a combo box with options of payment terms from the payment terms table.
How can this be done in ruby on rails? I only want that the payment_term combo box be displayed when the service_type chosen has an isCredit value 1 else the services.payment_terms = 0