by jstin · 12y ago · 0 comments
I find this pattern to be the most manageable especially in large projects.
But I agree with your point. "if current_user" is miles better than "if current_user.name != 'Guest'".
Edited to add: As far as this articles use of current_user.name being guest, it makes sense to use a presenter to display the data in the view. Conditionally displaying a user name or 'Guest' in a view is kinda gross. Again I'll suggest a gem for this pattern https://github.com/drapergem/draper
All objects coming into the view should be wrapped, especially and ActiveRecord objects.