undefined method `all' for Directory:Module
Hi,
I followed the installation guidelines and went to http://localhost:3000/admin but I got this error:
undefined method `human_attribute_name' for Company:Class
Please advise. Thanks
First of all, sorry for the slow response to your question.
undefined method `human_attribute_name' for Company:Class
This seems to indicate that the Company class is not a subclass of ActiveRecord::Base. If you are using an alternative ORM, you may need to customize the adapter, or override the adapter methods on a per-admin basis.
Trestle.resource(:companies) do
adapter do
def human_attribute_name(attribute)
attribute.to_s.titleize
end
end
end
undefined method `all' for Directory:Module
This indicates that the model for your admin resource isn't being inferred correctly. You might need to specify it explicitly as an option:
Trestle.resource(:directories, model: MyDirectoryClass)
end