I have an object that has a to_csv
method and I want to pass it to respond_with
to render csv from my controller. My code looks like this:
I ran into what I would guess is a similar problem to what you were experiencing, Oliver. I realized that in my routes file I was using resource
instead of resources
. I do not know if you have other actions in your Admin::ReportsController class or what your routes file looks like, but this is how I would tackle the problem if Reports has the standard REST actions.
scope :module => 'Admin' do
resources :reports do
get :trips, :on => :collection
end
end
If that does not apply, run rake routes
to see if your routes are configured correctly.