|
[
Permalink
| « Hide
]
Jonathan Rochkind added a comment - 15/Apr/10 12:36 PM
Boy, the weird f[] stuff in the request parameters makes it hard to do this cleanly and DRY.
Fixed and committed.
There is a helper method search_as_hidden_fields which will take the current request params and turn them into hidden form fields, with hash's and arrays done in Rails style. This uses the new HashAsHiddenFields helper that I found on google. This method takes an optional argument of certain keys to admit (:sort, :per_page, :page, etc). search_form and sort_and_per_page both use this method now, nice and DRY. This method includes ALL existing params _except_ certain specified ones to omit -- so it's nice and future-proofed for future extensions that add more request keys that need to be preserved (like advanced search field). The former _hidden_filters partial is removed, it is now handled fine by the more general #search_as_hidden_fields specs for all new methods, feature testing that this issue is indeed resolved.
Jonathan Rochkind made changes - 15/Apr/10 04:27 PM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||