I have a search form and phone number verification form i would like know how associate the forms, i want display the search results only after the phone validation and the user fills out only one form with product criteria and his phone number for the validation,
My search form
<%= form_tag recherche_path, id: "address_input", method: :get, autocomplete: 'on' do %>
<%= text_field_tag :location, params[:location], {id: 'address', class: "namanyay-search-box", placeholder: 'Adresse du bien à vendre', :required => true} %>
<%= text_field_tag :room_type, params[:room_type], {class: "namanyay-search-box-type", :required => true} %>
<%= submit_tag "Trouver une agence", id: "namanyay-search-btn" %>
<% end %>
My phone number validation form
<%= form_for PhoneNumber.new, remote: true do |f| %>
<div class="form-group">
<%= f.text_field :phone_number, class: "namanyay-search-box" %>
</div>
<%= f.submit "Envoyer", class: "btn btn-danger", id: 'send-pin-link' %>
<% end %>
</div>
<div id="verify-pin">
<%= form_tag phone_numbers_verify_path, remote: true do |f| %>
<%= hidden_field_tag 'hidden_phone_number', '' %>
<div class="form-group">
<%= text_field_tag :pin %>
</div>
<%= submit_tag "Verifier", class: "btn btn-danger" %>
<% end %>
I dont know how make it work in my controller