Forum: Ruby on Rails Newbie question: XML Templates

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
E5565e2e5b83aacb8266726073d2bed5?d=identicon&s=25 Mark W. (Guest)
on 2006-01-26 14:22
(Received via mailing list)
I would like to be able to produce both HTML and XML-based views as I
create my
Rails application (models and controllers) - meaning creating/tweaking
templates to augment the default (HTML) view templates.

Is there an easy way to do this?

To take this one step further, I would like Rails to differentiate
between my
two types of clients. Assuming I can auto-generate the HTML and XML
views I
want, how do I get Rails to respond in the way appropriate to a
client type?

As background, I am trying to build a dynamic, rich client that will
obtain and
display Rails "results"  by interpreting XML output - all the while
the default HTML interface for testing or, perhaps, less capable

To give a concrete example, both the HTML browser and my rich client can
request to add a category to my recipe book. The browser does it using
default view template. My rich client does it using code. I can very
change the code to POST additional parameters (to indicate I want XML in
response) - but how do I embed this parameter in Rails templating
mechanism to
make sure Rails knows to reply with a XML each time I create a new model

Thanks to anyone who can help!

This topic is locked and can not be replied to.