我收到“未捕获的错误:RuntimeError:编辑似乎不是反应组件。” 消息,尽管在同一模块中定义了编辑:
module Components
module Admin
module Discounts
class Layout < Hyperloop::Router::Component
render(DIV) do
Switch do
Route("#{match.url}/index") do
Redirect(pathname: match.url, search: location.search)
end
Route(match.url, exact: true) do |m, l, h|
Index(match: m, location: l, history: h)
end
Route("#{match.url}/:discount_id/edit") do |m, l, h|
Edit(match: m, location: l, history: h)
end
Route("#{match.url}/new") do |m, l, h|
New(match: m, location: l, history: h)
end
end
end
end
end
end
end
module Components
module Admin
module Discounts
class Edit < Hyperloop::Router::Component
...
但是,我有另一个文件 models/edit.rb 似乎被使用了
module Edit
def backup(attr_whitelist, assoc_whitelist)
@saved_attributes = attributes_as_json(attr_whitelist, assoc_whitelist)
end
关于为什么会发生这种情况/如何指向 Edit 类的任何想法?