aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/track_controller.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-05-03 18:56:21 +0100
committerRobin Houston <robin.houston@gmail.com>2012-05-04 15:13:37 +0100
commit88d5103ec40120b64a7579994ad2f11334dee71a (patch)
tree5dc543bec817d68a382d37d7dbe3b0eea43b3c1e /app/controllers/track_controller.rb
parent5344f5dad381698cf4de9361c7a39aefb3eb2e8d (diff)
Filter public body tracks by event type
Add the facility to filter the public body feed by event type using a query string parameter, e.g. event_type=sent.
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r--app/controllers/track_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index d858ab233..95b573cdc 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -50,11 +50,15 @@ class TrackController < ApplicationController
raise ActiveRecord::RecordNotFound.new("None found") if @public_body.nil?
# If found by historic name, or alternate locale name, redirect to new name
if @public_body.url_name != params[:url_name]
- redirect_to track_public_body_url(:url_name => @public_body.url_name, :feed => params[:feed])
+ redirect_to track_public_body_url(:url_name => @public_body.url_name, :feed => params[:feed], :event_type => params[:event_type])
return
end
- @track_thing = TrackThing.create_track_for_public_body(@public_body)
+ if params[:event_type]
+ @track_thing = TrackThing.create_track_for_public_body(@public_body, params[:event_type])
+ else
+ @track_thing = TrackThing.create_track_for_public_body(@public_body)
+ end
return atom_feed_internal if params[:feed] == 'feed'