在设置简单的“显示所有事物”视图时,我遇到了开拓者的问题。
手术
class Thing < ApplicationRecord
class ShowAll < Trailblazer::Operation
include Model
model Thing, :all #why :all is not working here?
def process
end
end
end
控制器
class PageController < ApplicationController
def index
run Word::ShowAll
end
end
为什么:all
不能从数据库中获取所有东西,而是:find
通过它的 id 获取一个?