Я пытаюсь отредактировать несколько записей с использованием одной формы, поэтому пользователь может редактировать несколько записей, а затем пресса отправлять в конце, а не после каждого отдельного. Я отправил свой текущий код, и я получаю эту ошибку:Редактирование нескольких записей в одной форме - Rails
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"
Вы можете обновить включить ваши маршруты.rb? – zeantsoi
обновил мой ответ! – user1738017