Question

I use redactor rails gem.

When I try to upload picture, I see:

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'

What actually points that this doesn't pass my custom authorization:

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

Current permission is made like this:

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

What have I tried:

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

None of that works.

Any ideas?

Was it helpful?

Solution

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

So, the main useful information - that's how you declare controller method somewhere to match redactor

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top