Forum: Ruby on Rails link_to query string

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.
matthew clark (Guest)
on 2006-01-22 06:52
(Received via mailing list)
Here's a simple one I think.

Using link_to,  how do you get multiple fields in the query string?

link_to("anchor text", {:action=>"neat_page", :field_1=>"value 1",
:field_2=>"value 2"})
-this only gets you field_1 in the query string

as does this -
link_to("anchor text", :action=>"neat_page", :field_1=>"value 1",
:field_2=>"value 2")

link_to("anchor text", :options=>{:action=>"neat_page", :field_1=>"value
1",
:field_2=>"value 2"})
- this gets you a querystring of
"options=actionneat_pagefield_1value+1field_2=value+2

matt
This topic is locked and can not be replied to.