Specify a different root path for logged in users without using Devise
问题 If the user is logged in, I want users#show to be the route path. Else, the route path should be static_pages#home. Please let me know how I can achieve this without using the Devise gem. 回答1: I think having if/else statements in your routes file isn't right. Think of it as a business logic in your routes files. You business logic should be in your Models (not necessarily an ActiveRecord, just any plain old ruby class would do) or if it better fits in your controller (like in this case) in