Hi,
A generator to update dashboards depending of new models or updated fields would be very useful.
It would avoid to write manually new dashboard configuration, and avoid to re-install everything.
What's your use case for this? Do you add so many fields to a model at once that it is a pain to add them also on the dashboard? Bare in mind that you don't have to add all fields to the dashboard, only those that are of interest to an admin.
I'm in the beginning of the development of my application so yes, I had a lot of fields and often. I use administrate to easily create data, in specifics cases and to edit them quickly.
Of course at the end, I plan to remote a part of the models in administrate but currently, all of my models are in the dashboard.
I use administrate not for the production, but for the development for the moment, it's why I think this generator could be useful.
What about add a bunch of new models? Use install task is not appropriate.
It's not on the docs, but you can run the dashboard generator for specific models.
rails generate administrate:dashboard MODEL
@ivobenedito Great tip.
@ivobenedito okay, thank you ! It's what I'm looking for. I think it could be a good idea to add it in the documentation, it's an useful generator.
I have this issue recently, it will be great if we have it in the README or documentation site.
Closing this as it seems to be solved with #684.
Most helpful comment
It's not on the docs, but you can run the dashboard generator for specific models.
rails generate administrate:dashboard MODEL