Newbie question: XML Templates

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs