Hi,
I am using devise and in my routes I have
authenticated :user do
....
end
So, some of my pages require authentication before being available to the user.
When being on development environment and I am trying to access a page that needs authenticated user, the application throws an exception:
ActionController::RoutingError (No route matches [GET] "/courses/8/preview"):
.....
I suppose that this one is thrown by devise gem code. Correct?
Then I am trying to rescue_from this error with my own custom method on ApplicationController. Like this:
rescue_from ActionController::RoutingError, ActiveRecord::RecordNotFound, :with => :custom_404
But my method is never called and I still get the ActionController::RoutingError.
What am I missing here?
Thanks in advance
Panayotis