# Respond to different format

**URL:** <https://www.ruby-forum.com/t/respond-to-different-format/123326>\
**Category:** Rails\
**Created:** [December 16, 2007, 4:24pm UTC](https://www.ruby-forum.com/t/respond-to-different-format/123326 "2007-12-16T16:24:35Z")\
**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 16, 2007, 4:24pm UTC](https://www.ruby-forum.com/t/respond-to-different-format/123326/1 "2007-12-16T16:24:35Z")

</div>

Hi,

I am now developing an application that require a function that output  
the format corrspending to the request required, such as if browser  
request html, it respond the data in html format, and output the csv  
formated file when client is requesting the csv presentation of data.

I am currently using the respond\_to block to enclose this dispatching  
of the different output requested from client. On Rails, it support to  
specify the html as parse from rhtml, but how to let rails to specify  
csv for output? and how to make a template for outputting csv like  
rhtml output html ?

Thank,  
Patrick
