0

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>
Ayman Salah
  • 1,039
  • 14
  • 35

1 Answers1

2

Would this help? Rails dependent collection_select fields in form

If not, I am about to build something and might be happy to share it if it isn't to ugly!

Community
  • 1
  • 1
Dan Laffan
  • 1,544
  • 12
  • 12