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 trial

Ruby

Joseph Hall
Joseph Hall
10,865 Points

Multi tiered longin/register system in rails

I am building an application in Ruby on Rails that has a 2 different pricing models. How do I create a login system for each pricing structure for devise?

The one similar to the gold and silver memberships at treehouse. Does the treehouse staff have any thought on this?

Joseph

Devise is an authentication system. It is only to tell you if this person is who they say they are.

What you are trying to do is treat authenticated people differently, this is often solved by having different roles - so you would have gold role and a silver role and changing the html generating views as appropriate .

When you come up with your different roles you need to make sure that people can't cheat so you need an authorization/permissions system in your web application.

A popular authorization system is CanCan which was written by Rails rails-dude-miester Ryan Bates - he also does a authorization from scratch video which is a must watch to remove the magic from authorization. It's important to have a clear understanding about authentication vs authorization or it's going to bite you hard.

This is a good stack overflow question and answer to get you going

Good luck Joseph * salutes *

Rich

1 Answer

Joseph Hall
Joseph Hall
10,865 Points

Hi Rich!

Yes the railscasts guy is very trustworthy. I will check it out!

Joseph salutes back