tfwright / live_admin

Low-config admin UI for Phoenix apps, built on LiveView
MIT License
266 stars 27 forks source link

Some README suggestions #82

Closed hassanshaikley closed 1 year ago

hassanshaikley commented 1 year ago

I came to this project because the docs / setup for Kaffy were lacking and setup was taking too long.

So I have some suggestions to make suggestions for this lib better imho.

Suggestion One

Put

Finally, tell LiveAdmin what Ecto repo to use to run queries in your runtime.ex: config :live_admin, ecto_repo: MyApp.Repo

In a block like

Finally, tell LiveAdmin what Ecto repo to use to run queries in your runtime.ex:

config :live_admin, ecto_repo: MyApp.Repo

Suggestion two

You have this line of code in the README

    admin_resource "/my_schemas", MyApp.MyResource

It would really help to generate the first parameter dynamically, and for the second parameter specify that it is a schema, maybe have a comment above or any sort of thing to make it clearer.

# The second is the module for the Schemas, for instance the Ecto Schema

Suggestion three

putting the following in runtime.ex

config :live_admin, ecto_repo: MyApp.Repo

Will result in an error in development.

So like that should be fixed.


This is a great initiative and I want to see it succeed. I would love to submit PRs for the following items if you let me know how the README is generated. I don't want to spend time understanding how that happens right now.

tfwright commented 1 year ago

I've implemented your first suggestion as I agree that is more consistent. I'm not sure I agree your second suggestion makes things much clearer, the second parameter is not necessarily a schema, there is a note about that already.

As for the 3rd point, that sounds like a bug, can you open a new issue using the bug report template and provide the extra information to facilitate troubleshooting? Thanks!

tfwright commented 1 year ago

I also intentionally require the path to be specified explicitly so as to remain closer to the Phoenix router syntax.