CanCan load_and_authorize_resource triggers Forbidden Attributes

后端 未结 2 1916
梦如初夏
梦如初夏 2021-02-12 18:35

I have a standard RESTful controller that uses strong parameters.

class UsersController < ApplicationController
  respond_to :html, :js

  def index
    @user         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 19:15

    before_filter do
      params[:user] = safe_params
    end
    load_and_authorize_resource
    

提交回复
热议问题