Fix json rendering error
This commit is contained in:
@@ -1,11 +1,19 @@
|
|||||||
class Api::ApiController < ActionController::API
|
class Api::ApiController < ActionController::API
|
||||||
include TokenVerification, MultiTenancy
|
include MultiTenancy
|
||||||
|
include TokenVerification
|
||||||
include ActionController::MimeResponds
|
include ActionController::MimeResponds
|
||||||
|
include ActionView::Rendering
|
||||||
|
|
||||||
# before_action :lookup_domain
|
# before_action :lookup_domain
|
||||||
helper_method :current_token, :current_login_employee, :get_cashier
|
helper_method :current_token, :current_login_employee, :get_cashier
|
||||||
|
|
||||||
private
|
private
|
||||||
|
# ActionView::Rendering override render_to_body breaks render :json,
|
||||||
|
# resulting in an ActionView::MissingTemplate error.
|
||||||
|
def render_to_body(options)
|
||||||
|
_render_to_body_with_renderer(options) || super
|
||||||
|
end
|
||||||
|
|
||||||
#this is base api base controller to need to inherit.
|
#this is base api base controller to need to inherit.
|
||||||
#all token authentication must be done here
|
#all token authentication must be done here
|
||||||
#response format must be set to JSON
|
#response format must be set to JSON
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
include LoginVerification, MultiTenancy
|
include MultiTenancy
|
||||||
|
include LoginVerification
|
||||||
|
|
||||||
#before_action :check_installation
|
#before_action :check_installation
|
||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
@@ -17,5 +18,4 @@ class ApplicationController < ActionController::Base
|
|||||||
flash[:warning] = exception.message
|
flash[:warning] = exception.message
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class BaseController < ActionController::Base
|
class BaseController < ActionController::Base
|
||||||
include MultiTenancy
|
include MultiTenancy
|
||||||
layout "installation"
|
|
||||||
protect_from_forgery with: :exception
|
|
||||||
|
|
||||||
|
layout "installation"
|
||||||
|
|
||||||
|
protect_from_forgery with: :exception
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class BaseCrmController < ActionController::Base
|
class BaseCrmController < ActionController::Base
|
||||||
include LoginVerification,
|
include MultiTenancy
|
||||||
|
include LoginVerification
|
||||||
|
|
||||||
layout "CRM"
|
layout "CRM"
|
||||||
|
|
||||||
before_action :check_user
|
before_action :check_user
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class BaseInventoryController < ActionController::Base
|
class BaseInventoryController < ActionController::Base
|
||||||
include LoginVerification, MultiTenancy
|
include MultiTenancy
|
||||||
|
include LoginVerification
|
||||||
|
|
||||||
layout "inventory"
|
layout "inventory"
|
||||||
|
|
||||||
before_action :check_user
|
before_action :check_user
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class BaseOqsController < ActionController::Base
|
class BaseOqsController < ActionController::Base
|
||||||
include LoginVerification, MultiTenancy
|
include MultiTenancy
|
||||||
|
include LoginVerification
|
||||||
|
|
||||||
layout "OQS"
|
layout "OQS"
|
||||||
|
|
||||||
before_action :check_user
|
before_action :check_user
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class BaseOrigamiController < ActionController::Base
|
class BaseOrigamiController < ActionController::Base
|
||||||
include LoginVerification, MultiTenancy
|
include MultiTenancy
|
||||||
|
include LoginVerification
|
||||||
|
|
||||||
layout "origami"
|
layout "origami"
|
||||||
|
|
||||||
before_action :check_user
|
before_action :check_user
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class BaseReportController < ActionController::Base
|
class BaseReportController < ActionController::Base
|
||||||
include LoginVerification, MultiTenancy
|
include MultiTenancy
|
||||||
|
include LoginVerification
|
||||||
|
|
||||||
layout "application"
|
layout "application"
|
||||||
|
|
||||||
before_action :check_user
|
before_action :check_user
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
class BaseWaiterController < ActionController::Base
|
class BaseWaiterController < ActionController::Base
|
||||||
include LoginVerification, MultiTenancy
|
include MultiTenancy
|
||||||
|
include LoginVerification
|
||||||
|
|
||||||
layout "waiter"
|
layout "waiter"
|
||||||
|
|
||||||
before_action :check_user
|
before_action :check_user
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ module MultiTenancy
|
|||||||
included do
|
included do
|
||||||
set_current_tenant_through_filter if respond_to? :set_current_tenant_through_filter
|
set_current_tenant_through_filter if respond_to? :set_current_tenant_through_filter
|
||||||
before_action :find_shop_by_subdomain_or_frist if respond_to? :before_action
|
before_action :find_shop_by_subdomain_or_frist if respond_to? :before_action
|
||||||
helper_method :current_shop if respond_to? :helper_method
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user