administrate icon indicating copy to clipboard operation
administrate copied to clipboard

Can't display resources for which there is no dashboard

Open pablobm opened this issue 3 years ago • 1 comments

  • What were you trying to do?

Displaying (small display with display_resource) a resource for which there is no dashboard.

  • What did you end up with (logs, or, even better, example apps are great!)?

The app breaks as it requires a dashboard.

  • What versions are you running?

    • Rails 6.1
    • administrate 0.16
  • Additional information

This was first raised at https://github.com/thoughtbot/administrate/pull/346#issuecomment-986244231 by @nickrivadeneira. It wasn't possible to reopen, and it's a slightly different use case anyway, so I'm creating a new issue to track that.

pablobm avatar Dec 28 '21 09:12 pablobm

@nickrivadeneira, thank you for the report. I see what you mean.

I'm unsure as to how to fix this. On one hand, I feel that defining the dashboard only to provide display_resource might be the "correct" thing to do, but I see that it might not be very friendly. A way to improve this would be to catch the error at display_associated_resource and replace it with a better one that explains the situation.

But I'm open to other ideas. Do you have anything specific in mind?

pablobm avatar Dec 28 '21 09:12 pablobm