query strings built by R method can't handle multiple values from checkbox selections<br><br>R(SomeRoute, :reply_status=>%w{1 2 4}) <br>should return<br>query_string="<a href="http://localhost:3301/someroute/?reply_status_id=1&reply_status_id=2&reply_status_id=4">http://localhost:3301/someroute/?reply_status_id=1&reply_status_id=2&reply_status_id=4</a>"<br>
<br>qsp(query_string) -> {"reply_status_id"=>["1", "2", "4"]}<br>
<br><br>from camping_unabridged.rb<br> def R(c,*g)<br> p,h=/\(.+?\)/,g.grep(Hash)<br> g-=h<br> raise "bad route" unless u = c.urls.find{|x|<br> break x if x.scan(p).size == g.size &&<br>
/^#{x}\/?$/ =~ (x=g.inject(x){|x,a|<br> x.sub p,C.escape((a[a.class.primary_key]rescue a))})<br> }<br> h.any?? u+"?"+h[0].map{|x|x.map{|z|C.escape z}*"="}*"&": u<br>
end<br><br>----<br>i think it would work if modified as:<br><br> h[0].map{|x|<br> k, v=x<br> if v.is_a?Array<br> v.map{|v2| [C.escape( k), C.escape( v2)]*"="} * "&"<br>
else<br> x.map{|z| C.escape z}*"="<br> end<br> }*"&"<br><br><br clear="all">