If I'm in an RHTML view in Rails, it is easy to URL-escape something:
<a href="/redirect?href=<%=u target %>">Foo</a>
How do I do this in a string? I'd like to do something like this:
<% redirect_href = "/redirect?#{url_escape target}&foo=bar&baz=some_other_stuff" -%>
<a href="<%= redirect_href =>">Foo</a>
This must be trivial, right?