Dynamic Nested Forms in Ruby on Rails
With dynamic nested forms, you can create forms that automatically calculate fields based on the information that has been entered into previous fields. If you’re building a form for your online store, for example, you might want to create a product listing form with several different fields: name, category and price. If the user selects “blue jeans” as their category and then enters $50 as their price, then the form will automatically calculate all of the necessary information—including tax—and display it in an easy-to-read format.