More CSS simplification
Edit domain names, updates credentials and virtuals Model domain tests for length and valid characters
This commit is contained in:
@@ -36,8 +36,21 @@ class DomainsController < ApplicationController
|
||||
|
||||
# PATCH/PUT /domains/1 or /domains/1.json
|
||||
def update
|
||||
pre_domain_name = @domain.domain
|
||||
respond_to do |format|
|
||||
if @domain.update(domain_params)
|
||||
# now we need to update the credentials and virtuals
|
||||
|
||||
@domain.credentials.each do |credential|
|
||||
credential.email.sub! pre_domain_name, @domain.domain
|
||||
credential.save
|
||||
end
|
||||
|
||||
@domain.virtuals.each do |virtual|
|
||||
virtual.email.sub! pre_domain_name, @domain.domain
|
||||
virtual.save
|
||||
end
|
||||
|
||||
format.html { redirect_to domain_url(@domain), notice: "Domain was successfully updated." }
|
||||
format.json { render :show, status: :ok, location: @domain }
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user