How to use the same params in respond_to for some formats ?

C

Camille Roux

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 (same
:include, :eek:nly, :except, :methods).
In your opinion, what is the best way to do that?

Thank you
Camille Roux
 
B

Brian Candler

Camille said:
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 (same
:include, :eek:nly, :except, :methods).
In your opinion, what is the best way to do that?

respond_to is not a ruby method. My guess is that you are writing an
application in Rails. Rails has its own forums and you would do best to
ask there; this forums is for the Ruby programming language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,197
Messages
2,571,041
Members
47,634
Latest member
Alba16710

Latest Threads

Top