ActionController::RoutingError: uninitialized constant Api::V1::ApiController

拥有回忆 提交于 2019-12-05 10:19:14

You should be using the right constant while inheriting - ::Api::ApiController:

module Api::V1
  class Team::TeamController < ::Api::ApiController

because otherwise it is searching for Api::V1::ApiController, but should search for Api::ApiController

Right now you have Api::ApiController.
Your app/controllers/api/v1/api_controller.rb is missing V1 in namespace

module Api::V1
  class ApiController < ApplicationController
    ..
  end
end

UPDATE

If your ApiController is outside V1 folder then you should do

module Api::V1
  class Team::TeamController < ::Api::ApiController
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!