You pass false
to check_box_tag
, so all checkboxes are disabled. To fix this, you can do something like:
<%= check_box_tag 'user_ids[]', user.id, params[:user_ids].include?(user.id), :class => 'user_checkbox' %>
It checks if user.id
among the user IDs that were sent, and if it was then, the checkbox is selected.
source share