trestle
trestle copied to clipboard
How to fix "to_param called on non-resourceful admin. You may need to explicitly specify the admin."
I have an admin view set up similar to the following:
# admin.rb
Trestle.admin(:some_admin_view_showing_various_resource_tables) do
...
controller do
def show
@resource = Resource.find(params[:resource_id])
end
end
...
end
I also have a resource view set up like so
# resource.rb
Trestle.resource(:resource) do
table do
column :id
....
end
end
In the template I have
# admin/show.rb
...
<%= table ResourceAdmin.table, collection: resource.things %>
But I am getting the error to_param called on non-resourceful admin. You may need to explicitly specify the admin.
. I have also tried to pass in the table as admin: ResourceAdmin.table
but the error still shows. How do I fix this?
Have you tried passing in admin: ResourceAdmin
?