My favorites | Sign in
Logo
          
New issue | Search
for
| Advanced search | Search tips
Issue 335: Index and search should use render formats using common code
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  igal.koshevoy
Closed:  Dec 2008
Cc:  ben.hengst, jdcohenesq
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by igal.koshevoy, Dec 21, 2008
The EventsController#index and EventsController#search actions make a
series of very similar calls and render the same template. Unfortunately,
the #respond_to calls in each are unique, which means that while #index
responds to .json, the #search does not. While it'd be easy enough to just
add .json format support to #search, the correct solution to make both use
the same #respond_to block.

Ben Hengst and I prepared something and I'll finish it shortly.
Comment 1 by igal.koshevoy, Dec 21, 2008
Fixed in r1359: Reworked EventsController#index and #search so that they use a common
render_events wrapper that provides generation of common formats, e.g., HTML,
JSON, ATOM, etc. Wrote spec examples for #index and #search.

Please review. The #index and #search specs repeat code, so it may make sense to
refactor the specs to eliminate the duplication.
Status: Fixed
Cc: ben.hengst jdcohenesq
Sign in to add a comment

Hosted by Google Code