Jacques’ Seafood Bread
A recipe from Jacques Pépin.
Happy cooking!
This approach satisfies a few common requirements:
CanCan::AccessDenied) should redirect to an error page.First, update your application controller.
Create app/views/error/403.html.erb. The contents of the file are unimportant.
Generate a new session controller:
rails g controller Sessions
Here’s how it should look:
Update your routes so Devise knows to make use of your new sessions controller.
Move your new session view (if you generated them) from /app/views/devise/session/new.html.erb to /app/views/session/new.html.erb.
HINT: Set config.consider_all_requests_local in /config/environments/development.rb to false to test this while in development.