Skip to content

Commit

Permalink
#10 🐛 fixed redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Gimbardo committed Dec 27, 2021
1 parent bb864d8 commit 3c531bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
ffi (1.15.4)
ffi (1.15.4-x64-mingw32)
globalid (0.5.2)
activesupport (>= 5.0)
Expand All @@ -110,12 +111,17 @@ GEM
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.6.1)
minitest (5.14.4)
msgpack (1.4.2)
nio4r (2.5.8)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
nokogiri (1.12.5-x64-mingw32)
racc (~> 1.4)
orm_adapter (0.5.0)
pg (1.2.3)
pg (1.2.3-x64-mingw32)
public_suffix (4.0.6)
puma (5.5.2)
Expand Down Expand Up @@ -184,6 +190,8 @@ GEM
rubyzip (2.3.2)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc (2.4.0-x64-mingw32)
ffi (~> 1.9)
sassc-rails (2.1.2)
Expand Down Expand Up @@ -237,6 +245,7 @@ GEM
zeitwerk (2.5.1)

PLATFORMS
ruby
x64-mingw32

DEPENDENCIES
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?

rescue_from CanCan::AccessDenied do |exception|
redirect_to new_user_session_path, :alert => exception.message
end

protected

def configure_permitted_parameters
Expand Down

0 comments on commit 3c531bc

Please sign in to comment.