First, render the select box with payment terms as hidden (by using specific css class for example). Let's assume it has id payment_terms .
Up vote 0 down vote favorite share g+ share fb share tw.
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 javascript ruby-on-rails ruby ruby-on-rails-3 link|improve this question edited Mar 8 at 8:46shingara15.9k12244 asked Mar 8 at 6:29Ali1,84921957 73% accept rate.
You need do it in Javascript. It's not a rails problem. – shingara Mar 8 at 8:45.
First, render the select box with payment terms as hidden (by using specific css class for example). Let's assume it has id payment_terms. Then render services select box with additional data attribute to keep track if service isCredit 0|1 data-iscredit=> Write a simple script in JS to handle change event on the select populated with services and show/hide payment_terms select depening on isCredit.
I'm assuming you're using jQuery. $("#services"). Change(function() { var selopt = $(this.childrenthis.
SelectedIndex), isCredit = parseInt(selopt. Attr('data-iscredit')); if (isCredit === 0) { $("#payment_terms").hide(); } else { $("#payment_terms").show(); } }).
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.