After installing CanCanCan development does not work anymore

48 views Asked by At

I am developing a Rails app and of course on my computer in development mode, so if there is an error, Rails returns a nice error page with all details.

Since I installed and started to use CanCanCan I get the erro message

We're sorry, but something went wrong.

Which is supposed to be for production mode. And the erro details disappeared. I did not change anything in my configurations.

Does anyone know what happened?

1

There are 1 answers

0
multipolygon On

Im not 100% sure what you are asking, but it might be that your new CanCanCan rules are actually triggering AccessDenied but that is leading to a new error that Rails can't get a trace on. For example, an error in 400.html

You could try:

https://github.com/ryanb/cancan/wiki/exception-handling

Something like:

class ApplicationController < ActionController::Base
  rescue_from CanCan::AccessDenied do |exception|
    redirect_to root_url, :alert => exception.message
  end
end