title: Dynamically change form based on value selected in combobox in Ruby on Rails
body: <p>I have the following tables:</p>
  
  <pre><code>Services
  ID| Service_type_id| desc| date|payment_terms
  
  Service_types
  ID|NAME|isCredit
  
  Payment_Terms
  ID|Payment_Term
  </code></pre>
  
  <p>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. </p>
  
  <p>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</p>