Ticket #92 (closed enhancement)

Opened 2 years ago

Last modified 21 months ago

Query string builder

Reported by: zimbatm Owned by: somebody
Priority: major Milestone:
Component: camping.rb Version: 1.5
Keywords: Cc:

Description (last modified by zimbatm) (diff)

Hello,

I propose to add a Camping::qs method that does the exact reverse than Camping::qs_parse. Combined in URL and R, it would allow you to build queries like that :

R(MyController, arg1, arg2, :q1=>[1,2,3])
  #=> /my_controller/1/2?q1=1&q1=2&q1=3

The following patch already implements that feature in camping-unabridged.rb. I didn't do too much optimisation yet.

Attachments

camping-r-with-qs.diff (2.6 kB) - added by zimbatm 2 years ago.

Change History

Changed 2 years ago by zimbatm

Changed 2 years ago by zimbatm

  • description modified (diff)

Changed 2 years ago by pvtilburg

I was about to suggest this myself. I'm very interested in it myself. At the moment I just do: R(Foo, bar, baz) + "?key=val" while I'd prefer to do: outputs = inputs.dup and then: R(Foo, bar, baz, inputs).

Changed 21 months ago by why

  • status changed from new to closed

Okay, this has been in for awhile now.

Note: See TracTickets for help on using tickets.