Forum: Ruby on Rails automatic URI encoding on url_for?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Carl Y. (Guest)
on 2006-04-16 10:31
(Received via mailing list)
I am trying to store a hash in a URL so that a search query can be
stored as a link.  Here is my code:

link_to('blah', url_for({:controller => 'search',
                           :action => 'advanced',
                           :query => @query,
                           :page => n})

@query is the hash I'm trying to store and later retrieve.  Right now
it appears to be turning into a plain string with all the keys and
values concatenated together.  I want to make it so that query is
automatically freeze-dried into URI-safe stuff and then reconstituted
as an instance variable when the URI is requested again.  Any

This topic is locked and can not be replied to.