app/controllers/application_controller.rb
def logged_in_user
    unless logged_in?
      store_location
      flash[:danger] = t('please_login')
      redirect_to login_url(subdomain: nil)
    end
  end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def logged_in_user
    unless logged_in?
      store_location
      flash[:danger] = t('please_login')
      redirect_to login_url(subdomain: nil)
    end
  end
def logged_in_user unless logged_in? store_location flash [ :danger ] = t ( 'please_login' ) redirect_to login_url ( subdomain : nil ) end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .