Forum: Ruby on Rails Newbie question: XML Templates

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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
XML-based
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
particular
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
retaining
the default HTML interface for testing or, perhaps, less capable
browsers.

To give a concrete example, both the HTML browser and my rich client can
POST a
request to add a category to my recipe book. The browser does it using
the
default view template. My rich client does it using code. I can very
easily
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
and
controller?

Thanks to anyone who can help!

-Mark
This topic is locked and can not be replied to.