app/views/collection_profiles/_form.html.erb
<%= form_for(@collection_profile) do |f| %>
<%= render 'shared/errors', object: @collection_profile %>
<div class="flexbox">
<div class="item item1">
<div class="field">
<%= f.label :container_id %><br>
<%= render 'workbench/elements/forms/ajax_select',
controller: 'containers',
object: 'collection_profile',
method: 'container_id',
tag_id: 'container_id_for_collection_profile',
size: 60,
display: container_tag(@collection_profile.container) %>
</div>
<div class="field">
<%= f.label :number_of_collection_objects %>
<br>
<%= f.number_field :number_of_collection_objects %> ( calculated items in this container: <%= container_collection_item_count(@collection_profile.container) -%> )
</div>
<div class="field">
<%= f.label :number_of_containers %>
<br>
<%= f.number_field :number_of_containers %> ( calculated containers in this container: <%= @collection_profile.try(:container).try(:descendants).try(:count) -%> )
</div>
</div>
<div class="item item2">
<div class="field">
<%= f.label :collection_type %>
<%= content_tag(:em, '(changing type will reset values)') -%>
<br>
<% COLLECTION_PROFILE_INDICES[:Favret].each_key do |v| -%>
<%= f.radio_button(:collection_type, v, class: [:collection_type_option]) -%> <%= label_tag(v, v) -%> <br>
<% end %>
</div>
<div class="field">
<%= f.label :otu_id %><br>
<%= render 'workbench/elements/forms/ajax_select',
controller: 'otus',
object: 'collection_profile',
method: 'otu_id',
tag_id: 'otu_id_for_collection_profile',
size: 60,
display: otu_autocomplete_selected_tag(@collection_profile.otu) %>
</div>
<div id="collection_profile_typed_attributes">
<%= render 'collection_profile_collection_type_attributes_form', collection_profile: @collection_profile, f: f -%>
</div>
</div>
</div>
<% unless f.object.new_record? -%>
<div class="field">
<%= f.label :force_update %>
<br>
<%= f.check_box :force_update %>
</div>
<% end %>
<div class="actions">
<%= f.submit %>
</div>
<% end %>