README.md in devise_masquerade-0.0.9 vs README.md in devise_masquerade-0.1.0
- old
+ new
@@ -4,10 +4,12 @@
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/oivoodoo/devise_masquerade)
[![endorse](https://api.coderwall.com/oivoodoo/endorsecount.png)](https://coderwall.com/oivoodoo)
+[![Analytics](https://ga-beacon.appspot.com/UA-46818771-1/devise_masquerade/README.md)](https://github.com/oivoodoo/devise_masquerade)
+
It's a utility library for enabling functionallity like login as button for
admin.
If you have multi users application and sometimes you want to test functionally
using login of existing user without requesting the password, define login as
@@ -30,11 +32,11 @@
= link_to "Login As", masquerade_path(user)
In the model you'll need to add the parameter :masqueradable to the existing comma separated values in the devise method:
devise :invitable, :confirmable, :database_authenticatable, :registerable, :masqueradable
-
+
Add into your application_controller.rb:
before_filter :masquerade_user!
Instead of user you can use your resource name admin, student or another names.
@@ -74,10 +76,10 @@
## You can redefine few options:
Devise.masquerade_param = 'masquerade'
Devise.masquerade_expires_in = 10.seconds
- Devise.masquerade_key_size = 16 # size of the generate by SecureRandom.base64
+ Devise.masquerade_key_size = 16 # size of the generate by SecureRandom.urlsafe_base64
## Demo project
cd spec/dummy
rake db:setup