require_dependency "jobshop/application_controller" module Jobshop class Teams::LookupsController < ApplicationController skip_before_action :authenticate_user! def show @lookup = Jobshop::User.new end def create emails = params[:user][:email].split(",").map(&:strip).take(5) Jobshop::Team.grouped_by_email(emails).each_pair do |email, teams| Jobshop::TeamsMailer.found_teams(email, teams).deliver_later end redirect_to new_user_session_path end end end