Ruby doesn't support method overriding, if several
methods with the same name are defined in a class - the latest overwrites
In this case, the methods that are in user.rb can only be
accessed/invoked through a user object.
user.remember // invoked by user object
cookies.permanent.signed[:user_id] = user.id
cookies.permanent[:remember_token] = user.remember_token
You will find that if you send a non-user object to your helper method,
it will return an error as this method can only be accessed by the user
This works the same if you were to define methods with the same name in
separate classes as they can only be accessed through the respective
If you were to include your helper in a controller and add a method in
your controller with the same name as the helper method, your controller
method would override the former method. Which would be the same as adding
two methods with the same name in the same controller. As stated above,
ruby doesn't allow method overriding.