I'm trying to achieve this url on my users profile in a cleaner way: Profile Address: localhost:3000/username
This is how I do it:
<%= link_to "localhost:3000#{root_path}#{@user.username}", @user.username %>
Quite an ugly way to do it. I could store the url I want in a variable in a helper or controller or something e.g. shortened_root_url = localhost:3000/ (or site name) and there are other ways I could do it ...
But isn't there a way I could just use root_url and have some magic remove the http:// from the url when displaying on users profile?
NOTE: I'm talking about the URL displayed to the user on his/her page, not in the href attr of an anchor tag.