validate error
This commit is contained in:
@@ -14,9 +14,9 @@ class Crm::CustomersController < BaseCrmController
|
||||
#@crm_customers = Customer.all
|
||||
@crm_customer = Customer.new
|
||||
|
||||
|
||||
# puts @crm_customer.valid?
|
||||
|
||||
if flash["errors"]
|
||||
@crm_customer.valid?
|
||||
end
|
||||
# @membership = Customer.get_member_group
|
||||
# if @membership["status"] == true
|
||||
# @member_group = @membership["data"]
|
||||
@@ -104,7 +104,9 @@ class Crm::CustomersController < BaseCrmController
|
||||
else
|
||||
|
||||
if params[:sale_id]
|
||||
flash[:errors] = @crm_customers.errors
|
||||
format.html { redirect_to '/origami/'+params[:sale_id]+'/add_customer'}
|
||||
format.json { render json: @crm_customers.errors, status: :unprocessable_entity }
|
||||
else
|
||||
flash[:errors] = @crm_customers.errors
|
||||
format.html { redirect_to crm_customers_path}
|
||||
@@ -148,7 +150,8 @@ end
|
||||
|
||||
else
|
||||
|
||||
format.html { render :index }
|
||||
flash[:errors] = @crm_customers.errors
|
||||
format.html { redirect_to crm_customers_path}
|
||||
format.json { render json: @crm_customer.errors, status: :unprocessable_entity }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user