Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEthan Moffat
184 PointsHow to make a user verified with devise e.g Twitter verified or user tags to be specific.
Howdy, I am wanting to make my team have different tags on the employee account but I can't quite think of a way to get around this. For an example all Treehouse teachers have a user tag as Treehouse teacher. I want my team to have a tag of Blogger on the employee's account and other tags that my employee's position will be.
I am using Rails 4.
Thank you for taking the time to read my question and I would greatly appreciate the help!
1 Answer
Houston Erekson
10,542 PointsI would make a user_role table with the roles (admin, user, writer, editor)
And give the User table a role_id column to reference the user's role. (1,2,3,4)
This give you the option to display the user's role on their profiles, as well as further authorization for your rails app.
With devise specifically there are other ways to do it.
https://github.com/plataformatec/devise/wiki/How-To:-Add-an-Admin-Role
https://github.com/plataformatec/devise/wiki/How-To:-Add-a-default-role-to-a-User
More than one way to skin a cat.