Guys that is my code thing is I want to select a parent subject and upon selection I need to use that selected subject to list the topics within it in the parent field how can i do that?
<label>Parent Subject</label>
<div class="field">
<%= collection_select :topic, :subject_id, Subject.all, :id, :name %>
</div>
<label>Parent Topic</label>
<div class="field">
<%= collection_select :topic, :parent_id, ?????, :id, :name %>
</div>