Soc/app/helpers/application_helper.rb

12 lines
205 B
Ruby
Raw Normal View History

2023-08-08 19:29:01 +00:00
# frozen_string_literal: true
module ApplicationHelper
2023-08-08 19:29:01 +00:00
def logged_in?
session[:user_id].present?
end
def current_user
@current_user ||= User.find(session[:user_id]) if logged_in?
end
end