# Restful output different file format

**URL:** <https://www.ruby-forum.com/t/restful-output-different-file-format/122789>\
**Category:** Rails\
**Created:** [December 12, 2007, 5:39am UTC](https://www.ruby-forum.com/t/restful-output-different-file-format/122789 "2007-12-12T05:39:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b2d939/32.png) [@patrick](https://www.ruby-forum.com/u/patrick)\
**Post date:** [December 12, 2007, 5:39am UTC](https://www.ruby-forum.com/t/restful-output-different-file-format/122789/1 "2007-12-12T05:39:14Z")

</div>

Hi,

I see the in the Resful Rails, it default support the output format of  
the controller action is html, rjs, xml …etc. And xml can generate  
from defineing a xml format in the rxml file. But how to define the  
output format that the rails is not support in default? Such as if i  
need to define the output to CSV format. I need to register the Mime  
in environment.rb, but how to define the template for outputing the  
file in csv format like using rxml to output file in xml format?

Thank~~~  
Patrick
