I'm getting the "Uncaught error: RuntimeError: Edit does not appear to be a react component." message, despite having edit defined within the same module:
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
...
However, I have another file models/edit.rb that seems to be used instead
module Edit
def backup(attr_whitelist, assoc_whitelist)
@saved_attributes = attributes_as_json(attr_whitelist, assoc_whitelist)
end
Any thoughts on why this is happening/how to point to the class Edit instead?