Add session & user management in the backend
This commit is contained in:
parent
9aee9adfce
commit
372fe53947
12 changed files with 88 additions and 11 deletions
|
|
@ -1,4 +1,14 @@
|
|||
class ApplicationController < ActionController::Base
|
||||
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
|
||||
allow_browser versions: :modern
|
||||
|
||||
def logged_in?
|
||||
if session[:user_id] then true else false end
|
||||
end
|
||||
|
||||
def current_user
|
||||
if logged_in?
|
||||
session[:user_id]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue