CanCan不上传图片到服务器(ckeditor)
CanCan does not upload images to the server (ckeditor)
当我上传图片到服务器时是向Ckeditor::PicturesController#create
请求(位于gem ckeditor)出现错误:
CanCan::AuthorizationNotPerformed (This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.)
我怎么能不使用monkeypatching(不在Ckeditor::PicturesController
中指定skip_authorization_check
),并在abillity.rb或另一个中解决这个问题方式
您是否尝试过在 ability.rb 中添加以下规则,如 docs 中所述?
can :access, :ckeditor
can [:read, :create, :destroy], Ckeditor::Picture
当我上传图片到服务器时是向Ckeditor::PicturesController#create
请求(位于gem ckeditor)出现错误:
CanCan::AuthorizationNotPerformed (This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.)
我怎么能不使用monkeypatching(不在Ckeditor::PicturesController
中指定skip_authorization_check
),并在abillity.rb或另一个中解决这个问题方式
您是否尝试过在 ability.rb 中添加以下规则,如 docs 中所述?
can :access, :ckeditor
can [:read, :create, :destroy], Ckeditor::Picture