I've seen plenty of code examples that show how to set the current user or subdomain to a variable. For example:
1 | class ProfileController < ActionController::Base |
However, I prefer this way:
1 | class ProfileController < ActionController::Base |
With this technique, I always use the current_user method to determine the current user, and never reference the @current_user variable. If an action doesn't need to know the current_user, no time is wasted to set it.
0 comments:
Post a Comment