<div>Thanks for taking time to look at this!&nbsp; I wanted to make sure that I wasn't going down a bad path.</div>  <div>&nbsp;</div>  <div>Greg<BR><BR><B><I>catalyst-request@lists.rawmode.org</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>Date: Mon, 29 Jan 2007 21:36:03 -0800<BR>From: Adam Jacob <BR>Subject: Re: [Catalyst] Tweaking REST<BR>To: claco@chrislaco.com, The elegant MVC web framework<BR><BR>Message-ID: &lt;94E045AB-5CF1-470F-B28C-C3A8A5618718@stalecoffee.org&gt;<BR>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed<BR><BR>On Jan 29, 2007, at 12:19 PM, Christopher H. Laco wrote:<BR>...<BR>&gt;&gt; As it stands now, REST JustWorks with xml/json stuff. text/html is<BR>&gt;&gt; mapped to YAML::HTML, but I want to map that to my standard TT <BR>&gt;&gt; view.<BR><BR>-------------- next part --------------<BR>An HTML attachment was scrubbed...<BR>URL:
 http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070130/490575b5/attachment-0001.htm<BR><BR>------------------------------<BR><BR>Message: 7<BR>Date: Tue, 30 Jan 2007 21:48:10 -0800<BR>From: Adam Jacob <ADAM@STALECOFFEE.ORG><BR>Subject: Re: [Catalyst] Re: Tweaking REST<BR>To: The elegant MVC web framework <CATALYST@LISTS.RAWMODE.ORG><BR>Message-ID: &lt;387C669B-D9A5-4A18-8ED7-BFF96AD90B80@stalecoffee.org&gt;<BR>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed<BR><BR>On Jan 30, 2007, at 11:01 AM, Greg McAlpin wrote:<BR><BR>&gt; I would very much appreciate feedback on my approach to using my TT <BR>&gt; view with REST. I'm just playing with the AdventREST example <BR>&gt; trying to understand the whole REST thing.<BR>&gt;<BR>&gt; I created a class (lib/AdventREST/MyREST.pm) for my controllers to <BR>&gt; inherit from. This class inherits from Catalyst::Controller::REST.<BR>&gt;<BR>&gt; In MyREST.pm, I override the 'end' method to either use the
 <BR>&gt; RenderView ActionClass or the Serialize ActionClass:<BR>&gt;<BR>&gt; sub _renderview : ActionClass('RenderView') {}<BR>&gt; sub _serialize : ActionClass('Serialize') {}<BR>&gt;<BR>&gt; sub end : Private {<BR>&gt; my ($self, $c) = @_;<BR>&gt;<BR>&gt; if ( $self-&gt;want_renderview($c) ) {<BR>&gt; $c-&gt;forward('_renderview');<BR>&gt; }<BR>&gt; else {<BR>&gt; $c-&gt;forward('_serialize');<BR>&gt; }<BR>&gt; where the want_renderview() method can be written however you want <BR>&gt; to (using the Content-Type or file extension or whatever).<BR><BR>That looks totally reasonable to me. What we are talking about it <BR>basically codifying that as a Serialization type, so that people can <BR>pass various content-types through to a given view.<BR><BR>Adam<BR><BR><BR><BR>------------------------------<BR></BLOCKQUOTE>