这是我的 model
class Equipment::Accepting < ApplicationRecord
end
这是我的 controller
class Api::App::Equipment::AcceptingsController < Api::App::ApplicationController
end
当我在我的 controller 里调用 Equipment::Accepting 时,会告诉我
=>NameError: uninitialized constant Api::App::Equipment::AcceptingsController::Equipment
然后我试着在 console 里调用 Equipment::Accepting
=>Equipment::Accepting (call 'Equipment::Accepting.connection' to establish a connection)
成功了。然后我试着创建一些新的 model,然后在 controller 里调用 Approval::Flow
=> Approval::Flow(id: integer, apply_id: integer, timestamp: datetime, to_id: integer, message: string, pass: boolean, is_sync: boolean, code: string, created_at: datetime, updated_at: datetime)
很奇怪的一个问题,尝试了许多办法。能给我指点一下的话,不胜感激。