backport exporter_controller changes from rails-3.1 branch