1 つのフォームを使用して複数のレコードを編集しようとしているので、ユーザーはいくつかのレコードを編集し、個々のレコードの後ではなく、最後に送信を押すことができます。現在のコードを投稿しましたが、次のエラーが発生します。
undefined method `connection_connection_path'
コントローラ
def show
@customer = Customer.find(params[:id])
@connection = @customer.connections
respond_to do |format|
format.html # show.html.erb
format.json { render json: @customer }
end
end
意見
<table class="table">
<thead>
<th>Interface</th>
<th>Device</th>
<th>Speed</th>
<th>Site</th>
<th>Capable</th>
<th>Notes</th>
</thead>
<%= form_for(@connection) do |f| %>
<% @connection.each do |l| %>
<tr>
<td><%= l.interface %></td>
<td><%= l.device %></td>
<td><%= l.speed %></td>
<td><%= l.site.name%> </td>
<td><%= f.check_box :check %></td>
<td><%= f.text_field :notes %></td>
</tr>
<% end %>
<tr><%= f.submit %></tr>
</table>
<% end %>
ルート
resources :connections
resources :sites
resources :customer_sites
resources :customers
root :to => "customers#index"