I think the point of the article you gave us is to say:
- request only if necessary.
What does it mean?
Take an example. You are an e-commerce website.
When should a customer finally register? During checkout. Never before. Therefore, you do not need to store or remember anything about the user. Devise is never, never used here.
How do you manage the shopping cart for an unsigned user / up? I would say a database with a session id as a primary key. Or you can save all ids elements in a cookie for later use.
In your code, if you have an action called checkout , just set before_filter authenticate_user!, :only => [:checkout] in your controller before_filter authenticate_user!, :only => [:checkout]
But maybe you have some limitations, for example, the ability to save your user nickname without signing it?
source share