Gem Ckeditor 报 CanCan::AuthorizationNotPerformed in Ckeditor::PicturesController#index

nancy · 2012年06月26日 · 最后由 nancy 回复于 2012年06月26日 · 3052 次阅读

Ckeditor 富文本上传图片时报 CanCan::AuthorizationNotPerformed in Ckeditor::PicturesController#index

大家是怎么处理的?

  • Callbacks ```ruby class ApplicationController < ActionController::Base

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

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 就好了

#1 楼 @zhangjingqiang 谢谢 我刚也找到了

需要 登录 后方可回复, 如果你还没有账号请 注册新账号