app/controllers/api/base_controller.rb
# Makes sure that the format for the request is an accepted one.
Makes sure that the format for the request is an accepted one.
Makes sure that the format for the request is an accepted one .
def ensure_format
    unless request.format.json?
      render( status: 406, json: { success: false, message: I18n.t("api.errors.request_must_be_json") } )
      return
    end
  end
def ensure_format unless request . format . json? render ( status : 406 , json : { success : false , message : I18n . t ( "api.errors.request_must_be_json" ) } ) return end end
Makes sure that the format for the request is an accepted one.
Makes sure that the format for the request is an accepted one .