Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Ethan Moffat
Ethan Moffat
184 Points

How 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
Houston Erekson
10,542 Points

I 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.