I have a Rails application that lists different teams in a list on one the views. The teams are links and used in the URL, for example localhost:3000/teams/chelsea
shows "chelsea".
If I have a team called man utd
when I click the link it escapes all the spaces so the URL is like:
localhost:3000/teams/<script>man%20utd
but I just it want it to be
localhost:3000/teams/<script>man utd
This is my code:
<a href="/<%= team["name"].html_safe %>"><%= team["name"] %></a>
I tried using html_safe
after reading other questions and also raw
but have had no luck with them.
What is the best way to solve this problem?