updates for new development env
This commit is contained in:
@@ -137,14 +137,19 @@ private
|
||||
def json_response(obj, options = {})
|
||||
if obj.is_a?(SimplyStored::Couch)
|
||||
if obj.errors.present?
|
||||
json_api_errors = obj.errors.details.map{|key, ers| {id: key, status: '422', title: ers.map{|e| e[:error].to_s}.join(', '), source: {parameter: key}}}
|
||||
#json_api_errors = obj.errors.details.map{|key, ers| {id: key, status: '422', title: ers.map{|e| e[:error].to_s}.join(', '), source: {parameter: key}}}
|
||||
json_api_errors = obj.errors.map{|error| {id: error.attribute, status: '422', title: error.message}}
|
||||
options.reverse_merge(json: {errors: json_api_errors, ok: false}, status: :unprocessable_entity)
|
||||
else
|
||||
options.reverse_merge(json: obj)
|
||||
end
|
||||
else # assume crude Hash
|
||||
obj[:ok] = true unless obj.has_key?(:ok)
|
||||
obj
|
||||
if obj[:errors]
|
||||
obj
|
||||
else
|
||||
obj[:ok] = true unless obj.has_key?(:ok)
|
||||
obj
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class SupplierController < Suppliers::ApplicationController
|
||||
def home
|
||||
if Rails.env.development?
|
||||
redirect_to "https://supplier.mozo.local/supplier/#{params[:other]}"
|
||||
redirect_to "https://localhost:4202/supplier/#{params[:other]}"
|
||||
else
|
||||
redirect_to "https://supplier.mozo.bar/supplier/#{params[:other]}"
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ module ApplicationHelper
|
||||
|
||||
def user_root_path
|
||||
case Rails.env
|
||||
when 'development' then 'https://user.mozo.local/'
|
||||
when 'development' then 'https://localhost:4201/'
|
||||
else 'https://user.mozo.bar/'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,6 +3,6 @@ iframe.phone-content-frame src=user_root_path
|
||||
|
||||
.tablet-wrapper
|
||||
- if Rails.env.development?
|
||||
iframe.tablet-content-frame src="https://supplier.mozo.local/supplier/"
|
||||
iframe.tablet-content-frame src="https://localhost:4202/supplier/"
|
||||
- else
|
||||
iframe.tablet-content-frame src="https://supplier.mozo.bar/supplier/"
|
||||
|
||||
Reference in New Issue
Block a user