Forum: Ruby on Rails automatic URI encoding on url_for?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eca15b2b601e7e577d38bd5210a753ac?d=identicon&s=25 Carl Youngblood (Guest)
on 2006-04-16 08: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
suggestions?

Thanks,
Carl
This topic is locked and can not be replied to.