Just the blockers now!!

This commit is contained in:
2024-05-10 07:27:32 +01:00
parent abff880184
commit e3901d26c6
6 changed files with 81 additions and 73 deletions

View File

@@ -24,12 +24,13 @@ class CredentialsController < ApplicationController
def create
@credential = Credential.new(credential_params)
@credential.domain_id = @domain.id
@credential.email << "@" << @domain.domain
respond_to do |format|
if @credential.save
format.html { redirect_to domain_path(@domain), notice: "Credential was successfully created." }
format.json { render :show, status: :created, location: @credential }
else
@credential.email.sub! ("@" + @domain.domain), ""
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @credential.errors, status: :unprocessable_entity }
end