app/controllers/supervisors_controller.rb
# Uses authenticate_user to redirect if no user is signed in
# and must_be_admin_or_supervisor to check user's role is appropriate
Uses authenticate_user to redirect if no user is signed in
and must_be_admin_or_supervisor to check user's role is appropriate
Uses authenticate_user to redirect if no user is signed in and must_be_admin_or_supervisor to check user ' s role is appropriate
def create
    @supervisor = Supervisor.new(supervisor_params.merge(supervisor_values))
    if @supervisor.save
      @supervisor.invite!
      redirect_to edit_supervisor_path(@supervisor)
    else
      render new_supervisor_path
    end
  end
def create @supervisor = Supervisor . new ( supervisor_params . merge ( supervisor_values ) ) if @supervisor . save @supervisor . invite! redirect_to edit_supervisor_path ( @supervisor ) else render new_supervisor_path end end
Uses authenticate_user to redirect if no user is signed in
and must_be_admin_or_supervisor to check user's role is appropriate
Uses authenticate_user to redirect if no user is signed in and must_be_admin_or_supervisor to check user ' s role is appropriate