I am wondering how to achieve this.
I have a list of types. Depending on a chosen type, either another select element will appear in the form or not.
For example, if type Page or Collection are chosen, another select field will appear under, listing all the pages.
For now I have this and I am not sure how to achieve my goal.
<div class="form-group mb-3"> <div> <%= select f, :type, ["Page": 1, "Category": 2, "Collection": 3, "Link": 4], placeholder: "Choose a type"%> <%= error_tag f, :type %> </div> </div>