Ckeditor 富文本上传图片时报 CanCan::AuthorizationNotPerformed in Ckeditor::PicturesController#index
大家是怎么处理的?
protected
# Cancan example def ckeditor_authenticate authorize! action_name, @asset end
# Set current_user as assetable def ckeditor_before_create_asset(asset) asset.assetable = current_user return true end end
* `cancan` 参照 [wiki](https://github.com/ryanb/cancan/wiki/Defining-Abilities)
在 github 上找到 class ApplicationController < ActionController::Base
# Set current_user as assetable def ckeditor_before_create_asset(asset) asset.assetable = current_user return true end end 就好了
#1 楼 @zhangjingqiang 谢谢 我刚也找到了