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

nancy · June 26, 2012 · Last by nancy replied at June 26, 2012 · 3053 hits

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 谢谢 我刚也找到了

You need to Sign in before reply, if you don't have an account, please Sign up first.