Well, here's a little help, please!
<%= form_tag(portabilizar_portabilidades_path, name: 'form', method: :get) do %>
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr>
<th> </th>
<th>Nº do contrato</th>
<th>Nova parcela</th>
<th>Verba proponente</th>
<th>Ação</th>
</tr>
</thead>
<tbody>
<% @autorizacoes.each do |autorizacao| %>
<tr>
<td><%= radio_button_tag "autorizacao", autorizacao.id %></td>
<td><%= autorizacao.numero_contrato %></td>
<td>
<input class="string required form-control" placeholder="Digite um valor" type="text" name="nova_parcela" id="portabilidade_nova_parcela">
</td>
<td>
<%= collection_select( :portabilidade, :verba, Verba.all, :id, :descricao, {prompt: "Selecione a verba"}, {class: "form-control"} ) %>
</td>
<td><%= submit_tag "Portabilizar", :class => 'btn btn-primary btn-portabilizar', :disabled => true %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
This is my view and my controller is this:
def portabilizar
@autorizacao = Autorizacao.find(params[:autorizacao])
autorizacao_selecionada = params["autorizacao"].to_i
@nova_parcela = params[:nova_parcela].to_i
@verba_proponente = params[:portabilidade][:verba]
I just need that when clicking on my radiobutton, enter the value in the input, click the button and save the values. But this is only happening with the last record. The previous records are being saved as null, how to solve this? I do not know what I'm doing wrong.