So I am fairly new to Rails and I need some help. I need to create a very basic app that will let users sign up for the site with email verification.
I plan to use Devise for my authentication. I am stuck as to when I am supposed to add this into my app and how to format it. Once someone signs up they need to go into a pending state until an admin approves them.
Also i have no idea how I would create an admin function that will create 1 super admin and give him the ability to designate other users as admins. Admins should have the ability move people from pending to active users.
I know this is a vague question but if anyone could steer me into the right direction it would be immensely helpful. Thank you!!
For the admin panel, instead of going crazy designing one, I’d recommend looking into https://github.com/gregbell/active_admin Active_Admin, which with basic configuration will essentially create a backend admin panel where you can manage any of your models, including a users model.
You can add devise into your app now — start with creating the correct routes based in the Devise documentation. Devise docs have a LOT of specific how-tos for your application – the time is in finding exactly what you’re looking for.
Here’s on making a user pending status:
https://github.com/plataformatec/devise/wiki/How-To:-Require-admin-to-activate-account-before-sign_in
Here’s how to add an admin role:
https://github.com/plataformatec/devise/wiki/How-To:-Add-an-Admin-role
I’d create the first admin in a rake task or via the console.
Hope this helps you get started. I really recommend just jumping in. Are you using any sort of version control?