ruby on rails - Path helper inserts plus sign instead of space -


i want have link_to with

<%= link_to "my link", search_path(par: "my link") %> 

but gets rendered

<a href="/search?par=my+link">my link</a> 

instead of

<a href="/search?par=my link">my link</a> 

is there way force behave properly, , not manually insert %20 instead of space?

try this

require 'cgi' cgi.unescape "/search?par=my+link" 

example:

1.9.3p448 :006 > cgi.unescape "/search?par=my+link"  => "/search?par=my link"   1.9.3p448 :007 > cgi.unescape "/search?par=my%20link"  => "/search?par=my link" 

hope helps!


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -