I’m using the acts_as_authenticated plugin. I have not yet modified the
AccountController much. All the default actions are still there
Then, I noted a strange behaviour: When the user is not logged on
tries to access the account/index action, the redirect to the signup
Here’s the code for the index action of the AccountController
say something nice, you goof! something sweet.
redirect_to(:action => ‘signup’) unless logged_in? || User.count > 0
There is the || User.count > 0 ? It is causing me problems, here is why
when the user is not logged in, the logged_in? returns false, but being
OR operation, if the User.count > 0, true prevails, so, it assumes the
is logged in when there is a user in the database.
Here’s the full controller code:
Does anyone know why the author did that?
Thanks in advance,