I’m trying to do a condition in my application.html.erb where if a user
is based off of a STI it has a “special” section in the navigation.
The following code correctly prints out the user type (either User or
<%= current_user.class if logged_in? %>
However, when I try to do an if search (example below) it work at all.
<%= content_tag(:li, link_to ("Products", productss_path)) if current_user.class == "Client" %>
If I change “Client” in the above code to “User” it still doesn’t work.
Is there some special case or usage required to handle
current_user.class in an if loop?
Thanks in advance!