aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/track_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r--app/controllers/track_controller.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index 15da7f327..9076148c4 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -3,7 +3,7 @@
# social bookmarking.
#
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
-# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
+# Email: hello@mysociety.org; WWW: http://www.mysociety.org/
class TrackController < ApplicationController
@@ -80,10 +80,7 @@ class TrackController < ApplicationController
# Track a search term
def track_search_query
- # XXX should be better thing in rails routes than having to do this
- # join just to get / and . to work in a query.
- query_array = params[:query_array]
- @query = query_array.join("/")
+ @query = params[:query_array]
# XXX more hackery to make alternate formats still work with query_array
if /^(.*)\.json$/.match(@query)
@@ -157,10 +154,10 @@ class TrackController < ApplicationController
def atom_feed_internal
@xapian_object = perform_search([InfoRequestEvent], @track_thing.track_query, @track_thing.params[:feed_sortby], nil, 25, 1)
respond_to do |format|
- format.atom { render :template => 'track/atom_feed', :content_type => "application/atom+xml" }
format.json { render :json => @xapian_object.results.map { |r| r[:model].json_for_api(true,
- lambda { |t| @template.highlight_and_excerpt(t, @xapian_object.words_to_highlight, 150) }
+ lambda { |t| view_context.highlight_and_excerpt(t, @xapian_object.words_to_highlight, 150) }
) } }
+ format.any { render :template => 'track/atom_feed.atom', :layout => false, :content_type => :atom }
end
end