From cbf0e738622af1edba270b272bd8c03bb80aae66 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Fri, 15 Jul 2011 18:23:04 +0200 Subject: [PATCH] override Controller#index to provide the respond_to hook that redmine_export uses for excel exporting --- app/controllers/cost_reports_controller.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/controllers/cost_reports_controller.rb b/app/controllers/cost_reports_controller.rb index 72e08409b1..12cc91995a 100644 --- a/app/controllers/cost_reports_controller.rb +++ b/app/controllers/cost_reports_controller.rb @@ -80,6 +80,19 @@ class CostReportsController < ApplicationController # end # end + ## + # @Override + # Use respond_to hook, so redmine_export can hook up the excel exporting + def index + super + respond_to do |format| + format.html { + session[report_engine.name.underscore.to_sym].try(:delete, :name) + render :action => "index" + } + end unless performed? + end + def drill_down redirect_to :action => :index end