0

I have this form:

<%= simple_form_for(@student) do |f| %>
  <%= f.input :first_name, label: "Nombre" %>
  <%= f.input :hours_studying, as: :select, collection: [1, 2], 
      prompt: 'Horas' %>
  <%= f.input :library_id, as: :select, collection: @libraries %>
  <div class="text-center">
    <%= f.button :submit, "Regístrame!", class: "btn button rounded-pill 
        p-3 my-4 fs-18 shadow" %>
  </div>
<% end %>

Libraries have a country and a city, how could I add two fields to the form to check the country and the city and filter the libraries accordingly?

problems
  • 95
  • 1
  • 8
  • Does this answer your question? [Rails dependent collection\_select fields in form](https://stackoverflow.com/questions/5311284/rails-dependent-collection-select-fields-in-form) – dbugger Oct 22 '20 at 13:21
  • I am not comfortable using jquery... – problems Oct 22 '20 at 13:52

0 Answers0