E. Almqvist 3 years ago
parent 9d05f99a8b
commit 4b762ca4a2
  1. 4
      src/func.rb

@ -7,7 +7,7 @@ def is_logged_in
session[:userid] != nil
end
def sesson_user
def get_current_user
session[:userid] && User.find_by_id(session[:userid])
end
@ -17,7 +17,7 @@ def serve(template, locals={}, layout: :layout)
locals[:error_msg] = session[:error_msg] or ""
session[:error_msg] = nil
#locals[:session_user] = get_current_user unless !is_logged_in
locals[:session_user] = get_current_user unless !is_logged_in
# Serve the slim template
slim(template, locals: locals, :layout => layout)

Loading…
Cancel
Save