<%# # BelongsToSearch Form Partial This partial renders an search input element for belongs_to relationships. By default, the input is a collection select box that displays all possible records to associate with. ## Local variables: - `f`: A Rails form generator, used to help create the appropriate input fields. - `field`: An instance of [BelongsToWithSearchField]. Contains helper methods for displaying a collection select box. %>
<%= f.label field.permitted_attribute %>
<% if field.associated_class == Place %> <%= render( partial: "fields/belongs_to_search/scope_package", locals: { f: f, field: field, }, ) %> <%else %> <%= f.select(field.permitted_attribute, nil, {}, 'data-url': polymorphic_url([namespace, field.associated_class], format: :json)) do %> <%= options_for_select(field.associated_resource_options, field.selected_option) %> <% end %> <% end %>