From 5b640cf9d85bf8b05c2af1dc0d0d42b632e3fc2c Mon Sep 17 00:00:00 2001 From: abythell Date: Thu, 2 Jan 2014 12:54:50 -0800 Subject: [PATCH] fix "Template Not Found" error --- app/controllers/status_controller.rb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/controllers/status_controller.rb b/app/controllers/status_controller.rb index 979869e..a851c5f 100644 --- a/app/controllers/status_controller.rb +++ b/app/controllers/status_controller.rb @@ -24,20 +24,21 @@ class StatusController < ApplicationController # set output correctly if params[:format] == 'xml' - @channel_xml = @channel.to_xml(channel_options).sub('', '').strip - @feed_xml = @feeds.to_xml(:skip_instruct => true).gsub(/\n/, "\n ").chop.chop + @channel_output = @channel.to_xml(channel_options).sub('', '').strip + @feed_output = @feeds.to_xml(:skip_instruct => true).gsub(/\n/, "\n ").chop.chop elsif params[:format] == 'csv' @csv_headers = [:created_at, :status] + @feed_output = @feeds else - @channel_json = @channel.to_json(channel_options).chop - @feed_json = @feeds.to_json + @channel_output = @channel.to_json(channel_options).chop + @feed_output = @feeds.to_json end # else set error code else if params[:format] == 'xml' - @channel_xml = bad_channel_xml + @channel_output = bad_channel_xml else - @channel_json = '-1'.to_json + @channel_output = '-1'.to_json end end @@ -46,10 +47,10 @@ class StatusController < ApplicationController # output data in proper format respond_to do |format| - format.html { render :text => @feed_json } - format.json { render :action => 'feed/index' } - format.xml { render :action => 'feed/index' } - format.csv { render :action => 'feed/index' } + format.html { render :text => @feed_output } + format.json { render "feed/index" } + format.xml { render "feed/index" } + format.csv { render "feed/index" } end end