# How to use the same params in respond\_to for some formats?

**URL:** <https://discuss.rubyonrails.org/t/how-to-use-the-same-params-in-respond-to-for-some-formats/48410>\
**Category:** rubyonrails-talk\
**Created:** [January 7, 2010, 1:21pm UTC](https://discuss.rubyonrails.org/t/how-to-use-the-same-params-in-respond-to-for-some-formats/48410 "2010-01-07T13:21:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [January 7, 2010, 1:21pm UTC](https://discuss.rubyonrails.org/t/how-to-use-the-same-params-in-respond-to-for-some-formats/48410/1 "2010-01-07T13:21:09Z")

</div>

Hello,

I want to make an API in XML and JSON (maybe more), and I want most of the time use the same parameters for the to\_xml and the to\_json at least (same :include, :only, :except, :methods). What is the best way to do that?

Thank you, Camille Roux
