I want my helpers to generate paths using a superclass instead of the subclasses. Assuming I have Owner and Member that both inherit from User, rails will use the current objects class name when generating paths:
Let’s say current_user is a mod: <%= link_to current_user.name, current_user %> will generate “/mod/:id”. I want to force it to generate “/user/:id” regardless of the subclass.
I can name the path:
<%= link_to current_user.name, user_path(current_user) %>
But I still want to use the convenience of just passing the object:
<%= link_to current_user.name, current_user %>
Is this possible?