Search code examples
ruby-on-railsrubyckeditormonkeypatchingcancancan

CanCan does not upload images to the server (ckeditor)


When I upload a picture to the server is a request to Ckeditor::PicturesController#create(it is located in gem ckeditor) and an error appears:

CanCan::AuthorizationNotPerformed (This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.)

how can I not using monkeypatching (not specify skip_authorization_check in Ckeditor::PicturesController), and solve this problem in abillity.rb or or another way


Solution

  • Have you tried to add the following rules in your ability.rb, like mentioned in the docs?

    can :access, :ckeditor
    can [:read, :create, :destroy], Ckeditor::Picture