In my controller I have an instance of a custom report class, the
instance responds to to_csv, which returns a csv string.  I was hoping
to be able to use respond_with, in the same way I would if I wanted a
json representation of this object.  Instead I see an error because
Rails is expecting there to be a template.

ActionView::MissingTemplate (Missing template admin/reports/trips with
{:formats=>[:csv], :handlers=>[:erb, :builder, :rjs, :rhtml, :rxml], 
:locale=>[:en, :en]}
in view paths

Is this the correct behaviour, I had a brief look through the rails
responder code and it looked to me like it should first try and render
a template, then if it can't find one try calling to_#{format}.

A sample of my code is in this gist https://gist.github.com/854903

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to