I have a set of objects. What I would like to do is iterate over the entire collection, but show each object on the page / view on its own and allow the user to interact with each object individually. Ideally, I would prefer not to use a multi-part form if I can avoid it, for the reasons stated at the end of my question.
I am trying to implement screens such as the images below.

Basically, the application user is sent to a location to reconcile the inventory (of each product) at that location. This is what the screens show. For each product, they must update inventory.
Summary and requirements are as follows:
- A
location has_many inventory_items. - A
user a reconciliation, . - A
reconciliation habtm inventory_items && belongs_to :location. - An
inventory_item habtm reconciliations && belongs_to :location. - ,
inventory_items . inventory_items.inventory_items , .... .
, :
class Reconciliation < ApplicationRecord
belongs_to :location
has_and_belongs_to_many :inventory_items
end
class Location < ApplicationRecord
has_and_belongs_to_many :products
has_many :inventory_items, inverse_of: :location
accepts_nested_attributes_for :inventory_items
has_many :reconciliations
end
class InventoryItem < ApplicationRecord
belongs_to :product
belongs_to :location, inverse_of: :inventory_items
has_and_belongs_to_many :reconciliations
end
inventory_items_reconciliations Join Table:
create_table "inventory_items_reconciliations", id: false, force: :cascade do |t|
t.bigint "inventory_item_id", null: false
t.bigint "reconciliation_id", null: false
t.index ["inventory_item_id", "reconciliation_id"], name: "index_inventory_item_id_reconciliation_id_join"
t.index ["reconciliation_id", "inventory_item_id"], name: "index_reconciliation_id_inventory_item_id_join"
end
routes.rb:
resources :locations, shallow: true do
resources :inventory_items
resources :reconciliations
end
ReconciliationsController#New:
def new
@location = Location.find(params[:location_id])
@reconciliation = @location.reconciliations.new
@inventory_items = @location.inventory_items
@num_of_inventory_items = @inventory_items.coun
end
app/views/reconciliations/new.html.erb:
<% @inventory_items.each do |inventory_item| %>
<%= render 'form', reconciliation: @reconciliation, inventory_item: inventory_item %>
<% end %>
app/views/reconciliations/_form.html.erb:
<%= simple_form_for @reconciliation, url: :location_reconciliations do |f| %>
<%= f.error_notification %>
<strong>Name</strong>: <%= inventory_item.product.name %> <br />
<strong>Quantity Left:</strong> <%= inventory_item.quantity_left %> <br />
<strong>Quantity Delivered:</strong> <%= inventory_item.quantity_delivered %> <br />
<div class="form-actions">
<%= f.button :submit, "Update", class: "btn btn-primary" %>
</div>
<% end %>
, , location.inventory_items , , , 1.
, :
inventory_items , .- .
- (.. "" ), ,
inventory_item reconciled, (.. ). - ,
inventory_items , reconciliation , inventory_item reconiliation cycle.
Wicked Gem, , . , inventory_item , .
.
, ?