I have a helper method which does this
def show_username(username, id)
if username == "Global_User"
"anonymously"
else
link_to username, profile_path(id)
end
end
but, i want to return the word “by” before the link_to username. The problem is when I put “by ” + link_to it breaks, and i cant use a do block on the link because thats the text inside the link (i dont want the word by to be a part of the link)
I’m calling it like
<%= show_username(resource.user.username, resource.user.id) %>
1 Answer