Rails play with Devise and Mongoid

Media_httpgemsgithubc_ygjiq

Here's a recent github repo https://github.com/rujmah/bearded-octo that I've set up.

Just playing with Devise to see what I can do with User models. I'm not too experienced with understanding how User models can work so this has been a learning curve. 

From the readme: 

Currently, Admin and Company. For 'Company' read 'regular User'.

Wanted to set up a User model that allowed for overall SuperAdmin/Access-All-Areas for Admin and restricted areas for other groups of users.

Several ways to go from here, but I have implemented (this round at least) a system where the controllers before filters figure out who gets access.

Quick but messy as I had to define methods on each controller (see below).  

Will be looking at other ways of doing this going forward. (Probably from looking at the Devise example apps: https://github.com/plataformatec/devise/wiki/Example-Applications)

 

Ryan Bates RailsCasts really got me up to speed very quickly on Rails authentication. Particularly, the following:

http://railscasts.com/episodes/250-authentication-from-scratch-revised

http://railscasts.com/episodes/209-introducing-devise

http://railscasts.com/episodes/235-omniauth-part-1

http://railscasts.com/episodes/241-simple-omniauth

 

 

Robin Mayfield

Robin Mayfield

Screenwriting, geeky thought crunching, breadmaking, wife-and-kids loving dude.
Twitter: @rujmah
blogs at rjjm.net

Posterous theme by Cory Watilo