Re: [Rails] Escaping characters in links

2011-05-21 Thread tommy xiao
hi, have a try: <%= link_to type.name, "#{types_path(type.name)}" %> keep the second parameter is string,right? 2011/5/21 tashfeen.ekram > I have the below link I am generating and type.name returns some > strings with a forward slash ("/"). This of course messes up routing. > I would like to

[Rails] Escaping characters in links

2011-05-20 Thread tashfeen.ekram
I have the below link I am generating and type.name returns some strings with a forward slash ("/"). This of course messes up routing. I would like to escape it to %2F however I am unclear on how to do that. <%= link_to type.name, types_path(CGI::escape(type.name)) %> If I do the below. it gives