app/controllers/logins_controller.rb
def create
    employee_exists = Employee.find_by_uid(params[:username].downcase)
    if employee_exists
      session[:results_per_page] = 25
      flash[:notice] = "Welcome " + employee_exists.first_name + "!"
      redirect_to home_pages_path
    else
      flash[:error] = "No employee with that ONID username is in the application"
      redirect_to logout_path
    end
  end
# Sets session value to current user/employee (currently unused)
Sets session value to current user/employee (currently unused)
Sets session value to current user / employee ( currently unused )
def create
    employee_exists = Employee.find_by_uid(params[:username].downcase)
    if employee_exists
      session[:results_per_page] = 25
      flash[:notice] = "Welcome " + employee_exists.first_name + "!"
      redirect_to home_pages_path
    else
      flash[:error] = "No employee with that ONID username is in the application"
      redirect_to logout_path
    end
  end
def create employee_exists = Employee . find_by_uid ( params [ :username ] . downcase ) if employee_exists session [ :results_per_page ] = 25 flash [ :notice ] = "Welcome " + employee_exists . first_name + "!" redirect_to home_pages_path else flash [ :error ] = "No employee with that ONID username is in the application" redirect_to logout_path end end
Sets session value to current user/employee (currently unused)
Sets session value to current user / employee ( currently unused )