fix "Template Not Found" error

This commit is contained in:
abythell 2014-01-02 12:54:50 -08:00
parent 94e937e35e
commit 5b640cf9d8
1 changed files with 11 additions and 10 deletions

View File

@ -24,20 +24,21 @@ class StatusController < ApplicationController
# set output correctly # set output correctly
if params[:format] == 'xml' if params[:format] == 'xml'
@channel_xml = @channel.to_xml(channel_options).sub('</channel>', '').strip @channel_output = @channel.to_xml(channel_options).sub('</channel>', '').strip
@feed_xml = @feeds.to_xml(:skip_instruct => true).gsub(/\n/, "\n ").chop.chop @feed_output = @feeds.to_xml(:skip_instruct => true).gsub(/\n/, "\n ").chop.chop
elsif params[:format] == 'csv' elsif params[:format] == 'csv'
@csv_headers = [:created_at, :status] @csv_headers = [:created_at, :status]
@feed_output = @feeds
else else
@channel_json = @channel.to_json(channel_options).chop @channel_output = @channel.to_json(channel_options).chop
@feed_json = @feeds.to_json @feed_output = @feeds.to_json
end end
# else set error code # else set error code
else else
if params[:format] == 'xml' if params[:format] == 'xml'
@channel_xml = bad_channel_xml @channel_output = bad_channel_xml
else else
@channel_json = '-1'.to_json @channel_output = '-1'.to_json
end end
end end
@ -46,10 +47,10 @@ class StatusController < ApplicationController
# output data in proper format # output data in proper format
respond_to do |format| respond_to do |format|
format.html { render :text => @feed_json } format.html { render :text => @feed_output }
format.json { render :action => 'feed/index' } format.json { render "feed/index" }
format.xml { render :action => 'feed/index' } format.xml { render "feed/index" }
format.csv { render :action => 'feed/index' } format.csv { render "feed/index" }
end end
end end