app.rb
# Checks to see if the user is logged in and is authorized via the session
Checks to see if the user is logged in and is authorized via the session
Checks to see if the user is logged in and is authorized via the session
def authorized?
      if logged_in? && session[:authorized]
      else
        flash[:danger] = 'You are not authorized to view this page'
        redirect '/'
      end
    end
def authorized? if logged_in? && session [ :authorized ] else flash [ :danger ] = 'You are not authorized to view this page' redirect '/' end end
Checks to see if the user is logged in and is authorized via the session
Checks to see if the user is logged in and is authorized via the session