私はオブジェクト配列を持っています。私はそれをループして結果をテーブルに出力しようとしています。テーブルの列の 1 つをレンダリングされた部分 (フォーム) にしたい。しかし、どの行で送信しても、常に最後の行出力のローカルが送信されます。
これはレールの通常の動作ですか、それとも何か間違ったことをしていますか?
私の見解は:
%table.table.table-hover
%thead
%tr
%th User id
%th User email
%th Account name
%th Intercom Conversation
%tbody
- @users.each do |user|
%tr
%td= user.user_id
%td= user.user_email
%td= user.account_name
%td
- if user.intercom_conversation
%h4= user.intercom_conversation
= link_to('edit', '#', {class: 'edit'})
.conversation_edit
= render(partial: 'conversation_form', locals: {user_id: user.user_id, fault_id: @fault.fault_id})
私のレンダリングされた部分は:
= form_tag('update_conversation', method: 'get')
= hidden_field_tag(:fault_id, fault_id)
= hidden_field_tag(:user_id, user_id)
yes
= radio_button_tag(:conversation, 0)
no
= radio_button_tag(:conversation, 1)
ignored
= radio_button_tag(:conversation, 2)
= submit_tag('Change')
私はすべてのレンダリングを言うべきだと思います(ブラウザでは正しく、エラーは発生しません)
前もって感謝します 。