Files
openfoodnetwork/app/controllers/api/base_controller.rb
2018-09-04 01:32:39 +08:00

18 lines
620 B
Ruby

# Base controller for OFN's API
# Includes the minimum machinery required by ActiveModelSerializers
module Api
class BaseController < Spree::Api::BaseController
# Need to include these because Spree::Api::BaseContoller inherits
# from ActionController::Metal rather than ActionController::Base
# and they are required by ActiveModelSerializers
include ActionController::Serialization
include ActionController::UrlFor
include Rails.application.routes.url_helpers
use_renderers :json
def respond_with_conflict(json_hash)
render json: json_hash, status: :conflict
end
end
end