Not work has_many :through association

In the view form of user

\- for user in User\.all
  = check\_box\_tag 'role\[user\_ids\]\[\]', user\.id, @role\.users\.include?


When I create a new user, nothing happens, the array of user_ids is

Those checkboxes will result in params['role[user_ids]'] being set to
an array of user ids - What does your controller code look like? If
it's just a classic User.create params[:user] that clearly isn't being
used at all


But that's not what your form (at least not in your initial post) is
doing - it's setting the attribute :user_ids in params[:role] which
you aren't using. Did you actually mean to create a checkbox
user[role_ids][] for each role ?


you are right, my mistake
in the user form i have this

\- for role in Role\.all
  = check\_box\_tag "user\[role\_ids\]\[\]", role\.id, @user\.roles\.include?


If you look at your development log file does it actually look like
those parameters are being submitted as you expected ?