-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add admin crud UI #626
base: add-authentication-via-devise
Are you sure you want to change the base?
Add admin crud UI #626
Conversation
812f532
to
ed2018c
Compare
@@ -23,6 +23,8 @@ gem "stimulus-rails" | |||
|
|||
gem "rollbar" | |||
|
|||
gem "kaminari" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scaffold uses .page
helper and assumes pagination. Comfy mexican suggests either Will Paginate or Kaminari gems:
https://github.com/comfy/comfortable-mexican-sofa?tab=readme-ov-file#dependencies
Pagination is handled by kaminari or will_paginate. Please add one of those to your Gemfile.
So brought in Kaminari just because we use it in Jupiter (no strong opinions otherwise)
@@ -0,0 +1,63 @@ | |||
# frozen_string_literal: true | |||
|
|||
class Admin::AdminsController < Comfy::Admin::BaseController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly all this code below is from the scaffold generator: https://github.com/comfy/comfortable-mexican-sofa/wiki/HowTo:-Reusing-Admin-Area
ed2018c
to
8562438
Compare
This PR builds off of #625 to add a CRUD UI for our new Admins resource
Most of this code was largely generated off the scaffold generator from ComfortableMexicanSofa.
In the CMS admin area, you will now have Admins and Log out links:
Clicking on the Admins link will take you to a full CRUD (create, read (index/show), update, delete) of the Admins resource.
Index:
Show:
Update:
New:
And you can delete users.
This is obviously very basic and simple, but should give you a foundation to add upon this and make it better.
You could later expand on this and include ability to invite admins (and remove the "new" admins stuff), ability to disable admins, add audit trail information and so forth (can take inspiration from Jupiter maybe for some of this, but by using Devise you have lots of guides/examples/solutions from the community you could adopt).
For the time being, this gives you an easy way to:
Improvements:
Add tests for these new screens (comfy generator added controller tests but these probably need to be fixed and refactored to work, but might be a great starting point)Future work: