Reputation: 879
I'd like to have something like this as output:
<a href="...">See Los Angeles</a>
or
<a href="...">See New York</a>
etc, so New York and Los Angeles would be a variable.
How can I achieve that with Rails? I read something and tried this, but it didn't work:
<%= link_to 'See #{@city.name}', @city %>
Thanks!
Upvotes: 0
Views: 1190
Reputation: 879
Nevermind, the above solution works but I had to put double quotes, not single. So this is the solution:
<%= link_to "See #{@city.name}", @city %>
Upvotes: 2