From: Florian Gilcher Date: 2008-03-01T05:21:26+09:00 Subject: Re: Convert characters from hex to string On Feb 29, 2008, at 9:08 PM, Shandy Nantz wrote: > Rick Denatale wrote: >> On 2/29/08, Shandy Nantz wrote: >>>> => "http://www.example.com/logic? >>> key for each user who is logging in, which becomes park of the link >>> string and then is passed to the view. However, the CGI.unescape >>> isn't >>> working. >> >> So presumably you are building the string without escapes in the >> controller. I suspect that it's getting escaped after that, probably >> in the view. How is the variable used in the view? As an argument to >> some helper, like maybe h? >> >> -- >> Rick DeNatale >> >> My blog on Ruby >> http://talklikeaduck.denhaven2.com/ > > It is used in a helper - link_to. What I am doing is to create a > variable to hold the link - @link. In the view I say: > > <%= link_to 'Travel', {:action => "#{@link}", :title => 'Book travel > online', :class => 'page_links', :target => 'new' %> > > But the data that is held within the @link variable has characters > that > are replaced with hex values. > > -S > -- > Posted via http://www.ruby-forum.com/. > You are abusing link_to. The syntax for linking to a pregenerated location is: <%= link_to 'Trave', @link, #the other arguments %> Otherwise, you generate a route within you controller with @link as :action parameter. And parameters will (and have to) be escaped by link generation. This is really much more of a question for the rails mailing list. Greetins Florian Gilcher