title: undefined method `to_key' for #<User::ActiveRecord_Relation:0x007f1bf8c2fd60>
body: <p>I am really new at rails so please forgive me if i can't see it. </p>
  
  <p>I am trying to edit the permissions on each individual user and i am getting this error in form_for:</p>
  
  <pre><code>undefined method `to_key' for #&lt;User::ActiveRecord_Relation:0x007f1bf8c2fd60&gt;
  </code></pre>
  
  <p>From what i have seen on other questions on stackoverflow, this usually happens when you try to call a collection in a form but this is not the case?</p>
  
  <p>view:</p>
  
  <pre><code>&lt;div class="n-container"&gt;
  &lt;tr-form data-riot riot-tag="tr-form"&gt;
  &lt;%= form_for(@user) do |f| %&gt;
  
      &lt;section&gt;
          &lt;div class="w-container"&gt;
              &lt;h1&gt;User permissions&lt;/h1&gt;
              &lt;% @permissions.each do |permission| %&gt;
                  &lt;%= check_box_tag 'permission_ids[]', permission.id %&gt;
                  &lt;div&gt;
                      &lt;%= permission.description %&gt;
                  &lt;/div&gt;
              &lt;% end %&gt;
          &lt;/div&gt;
      &lt;/section&gt;
  
      &lt;section&gt;
  
        &lt;div class="f-controls align-right"&gt;
          &lt;%= f.submit class: "btn fill blue", value: "Submit" %&gt;
        &lt;/div&gt;
  
      &lt;/section&gt;
  &lt;% end %&gt;
  &lt;/tr-form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>users_controller:</p>
  
  <pre><code>class UsersController &lt; ApplicationController
      def user_params
          params.require('user').permit(
              permissions: []
          )
      end
  
      def permissions
          @user = User.where(id: params[:user_id])
          @permissions = Permission.all
      end
  end
  </code></pre>
  
  <p>routes:</p>
  
  <pre><code>resources :users do
    get 'permissions'
    post 'permissions'
  end
  </code></pre>
  
  <p>Thank you in advance!</p>