Last active
June 11, 2020 23:56
-
-
Save staycreativedesign/0371646af3a9c20f371c29261f4cea53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveStorage::BaseController < ApplicationController | |
include ActiveStorage::SetCurrent | |
before_action :authenticate_user! | |
protect_from_forgery with: :exception | |
def authenticate_user! | |
if current_user | |
else | |
flash[:danger] = 'Unable to process your request' | |
redirect_to root_path | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just fix that conditional. 😄