Soc/app/helpers/application_helper.rb

18 lines
311 B
Ruby

# frozen_string_literal: true
module ApplicationHelper
def logged_in?
session[:user_id].present?
end
def current_user
@current_user ||= User.find(session[:user_id]) if logged_in?
end
def update_flash
turbo_stream.replace "flash_wrapper" do
render "shared/flash"
end
end
end