[Catalyst] returning empty 200 response

Matt S Trout dbix-class at trout.me.uk
Fri Oct 26 21:26:29 GMT 2007


On Fri, Oct 26, 2007 at 12:18:16PM -0700, Devo Coran wrote:
> hi
> 
> This is probably a basic question but after playing
> around for a few hours and going through the docs I
> haven't been able to figure it out. Appreciate it if
> maybe someone could point me in the right direction
> for docs.
> 
> Basically I"m doing an ajax save from a text area, so
> all I care about is that I get a 200 back from the
> framework I don't need a body, my text hasn't gone
> anywhere.
> 
> So I tried making a view to send a static response
> that only does
> 
> sub process {
>   my ($self, $c) = @_;
> }
> 
> then in my controller i do
> 
> $c->res->status(200);
> $c->res->body('');
> $c->detach('MyApp::View::Static');
>
> 
> but the problem is it keeps going to 
> /end
> MyApp::View::TT->process 
> 
> and wants an unnecessary template
> 
> I thought sending it to my static view handled that,
> any suggestions?

RenderView has no idea you did that, what you should have done is

$c->stash(current_view => 'Static');

so -it- forwarded to that view.

Better still, just do

$c->res->body(' ');

and RenderView will ignore you altogether :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list