Forum: Ruby on Rails custom mime types for respond_to

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joerg D. (Guest)
on 2006-06-08 14:12
Is there a way to add a mime type of my own to respond_to ?

There's html, xml, js, ical etc ...

But I want to be able to respond_to Excel.

Excel has the following content-type header:
application/vnd.ms-excel

I want to use the new ?format=xml querystring parameters that respond_to
can respond to.

So I want to pass in ?format=xsl or ?format=ms-excel so that I can
return my results formatted for Excel.

Any ideas? Or do I need to potter around in the mime_type.rb source
file?

Thanks
Joerg
This topic is locked and can not be replied to.