| Start |
|---|
| Getting Started So first we will create rails project and setup device create a rails application now add devise to gem list you can find a file named 'Gemfile' at the root of rails project Then run Next, you need to run the generator: Now on console you can find few instructions just follow it. Generate devise model Then run For more details go to: Devise Gem (opens new window) Authentication TokenAuthentication token is used to authenticate a user with a unique token, So
Before we proceed with the logic first we need to add Hence, Then run Now we are all set to do authentication using In First this line to it this will help rails application respond with both html and json Then will change this now we will add authentication method in application_controller So, by default Devise uses email as unique field we can also use custom fields, for this case we will be authenticating using user_email and auth_token. Note: Above code is purely based on your logic i am just trying to explain the working example On line 6 in the above code you can see that i have set |
Read Article
https://develop.horje.com/learn/1434/reference