Issue Details (XML | Word | Printable)

Key: CODEBASE-43
Type: New Feature New Feature
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Matt Mitchell
Reporter: Naomi Dushay
Votes: 0
Watchers: 0
Operations

Clone this issue
If you were logged in you would be able to see more operations.
Blacklight Plugin

facet params in URLs - make URLs less ugly

Created: 17/Mar/09 05:58 PM   Updated: 31/Jul/09 04:06 PM
Component/s: None
Affects Version/s: Down the Road
Fix Version/s: Down the Road


 Description  « Hide
we want to get away from square brackets:

from f[format_facet][]=Book

to something like
f.format_facet=Book

or even simpler, if possible:
f.format=Book

???

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Matt Mitchell added a comment - 20/Mar/09 08:51 AM
There is a module in the existing lib directory called MultiParam that can do this. The syntax goes from:

?f[format_facet][]=Book&f[location_facet][]=Alderman Library

to

?f.format_facet=Book&f.location_facet=Alderman

If you have multiple values for a single field, they can be separated like:

f.library_facet=Alderman|Ivy Annex

Here's the source and tests if you're interested:

http://blacklight.rubyforge.org/svn/branches/rails-engines/trunk/rails/vendor/plugins/blacklight/lib/multi_param.rb
http://blacklight.rubyforge.org/svn/branches/rails-engines/trunk/rails/vendor/plugins/blacklight/lib/multi_param_test.rb

Matt

Naomi Dushay added a comment - 20/Mar/09 01:08 PM
Matt has some code that did this. Naomi will talk to Matt.