@@ -24,7 +24,7 @@ def update
2424 redirect_to admin_users_path
2525 else
2626 flash [ :error ] = "Something didn't work quite right -- try again?"
27- redirect_back ( fallback_location : edit_admin_user_path )
27+ redirect_back_or_to ( edit_admin_user_path )
2828 end
2929 end
3030
@@ -81,23 +81,23 @@ def add_role
8181 resource_type : params [ :resource_type ] ,
8282 resource_id : params [ :resource_id ] )
8383 rescue => e
84- redirect_back ( fallback_location : admin_users_path , alert : e . message )
84+ redirect_back_or_to ( admin_users_path , alert : e . message )
8585 return
8686 end
87- redirect_back ( fallback_location : admin_users_path , notice : "Role added!" )
87+ redirect_back_or_to ( admin_users_path , notice : "Role added!" )
8888 end
8989
9090 def resend_invitation
9191 user = User . find ( params [ :user_id ] )
9292 user . invite!
93- redirect_back ( fallback_location : admin_users_path , notice : "#{ user . name } reinvited!" )
93+ redirect_back_or_to ( admin_users_path , notice : "#{ user . name } reinvited!" )
9494 end
9595
9696 def remove_role
9797 RemoveRoleService . call ( user_id : params [ :user_id ] , role_id : params [ :role_id ] )
98- redirect_back ( fallback_location : admin_users_path , notice : "Role removed!" )
98+ redirect_back_or_to ( admin_users_path , notice : "Role removed!" )
9999 rescue => e
100- redirect_back ( fallback_location : admin_users_path , alert : e . message )
100+ redirect_back_or_to ( admin_users_path , alert : e . message )
101101 end
102102
103103 private
0 commit comments