In my rails application I am using devise
gem for to manage users. I am using mobile_fu
gem for to separate users coming from different users.
What I want to achieve here is:
- If a user opens my site from a mobile device I will extract its
MSISDN
number reading header it is already done - If that
MSISDN
number falls in a particular series then I want to automatic login that user to my website so that he will not have to fill the sign_in form.
How I can achieve this?
You have to:
1) Register the user into the website for devise. 2) Login the user.
For option 1, you can do something like:
The things to have in mind, the first line tries to find for the user, on the second line, if it cannot find the user, it creates the user right away, then it sign_in the user, and finally redirect the user to where he should go after the login.