0

我使用 redactor rails gem。

当我尝试上传图片时,我看到:

Started POST "/redactor_rails/pictures?authenticity_token=g1JQetiggTDMwYoG2CnVz5ilnBoXReONW9iwgt5%2FJy4%3D" for 127.0.0.1 at 2013-07-31 22:02:10 +0400
Processing by RedactorRails::PicturesController#create as HTML
#other logs

ActionController::RoutingError (No route matches {:controller=>"info", :action=>"app_index"}):
  app/controllers/application_controller.rb:55:in `authorize'

实际上指出这没有通过我的自定义授权:

  def authorize
     @current_permission = current_permission
     if @current_permission.allow?(params[:controller], params[:action])
        return true
      else
      redirect_to root_url
    end
  end

当前的许可是这样的:

   allow :controller, [:m1, m2, ....]
   allow :users, [:new,:create,:uniqueness, :show, :create_guest, :edit_user_by_reset, :update_pass, :email_confirmation]
   # so on

我尝试了什么:

   allow "RedactorRails::PicturesController", [:create]
   allow  :pictures, [:create]
   allow :redactor_rails, [:create]

这些都不起作用。

有任何想法吗?

4

1 回答 1

0
   allow :"redactor_rails/pictures", [:index, :create]
   allow :"redactor_rails/documents", [:index, :create]

所以,主要有用的信息 - 这就是你如何在某处声明控制器方法以匹配编辑器

于 2013-08-05T13:37:16.850 回答