<%= form_for(@invoice) do |f| %>
  <% if @invoice.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@invoice.errors.count, "error") %> prohibited this invoice from being saved:</h2>

      <ul>
      <% @invoice.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :purchase_id %><br>
    <%= f.text_field :purchase_id %>
  </div>
  <div class="field">
    <%= f.label :reference_number %><br>
    <%= f.text_field :reference_number %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

<%= form_for(@invoice) do |f| %>
  <% if @invoice.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@invoice.errors.count, "error") %> prohibited this invoice from being saved:</h2>

      <ul>
      <% @invoice.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :purchase_id, "Purchase" %><br>
    <%= f.collection_select :purchase_id, Purchase.all, :id, :description %>
  </div>
  <div class="field">
    <%= f.label :reference_number %><br>
    <%= f.text_field :reference_number %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

Change text field to dropdown list
Change text field to dropdown list
