hidden_field_tag flattens my array for value

Try this:

<% for user in @users %>
    <%= hidden_field_tag "user_id[]", user.id %>
<% end %>

Maurício Linhares wrote:

Try this:

<% for user in @users %>
    <%= hidden_field_tag "user_id[]", user.id %>
<% end %>

This worked perfectly. Thank you.