"Kieren Diment" <[EMAIL PROTECTED]> writes:
> On 18/09/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> sub default : Private {
> my ( $self, $c ) = @_;
>
> # Hello World
> # $c->response->body( $c->welcome_message );
> $c->forward('View::TT');
>
> }
>
>
> Don't forward to View::TT in your default action, that's for end :
> Private, and doesn't need to be done at all if you're using
> Catalyst::Plugin::DefaultEnd or RenderView.
Thanks, I was thinking end when I did it... As it seems that Root.pm already
has RenderView, I'll leave it at that.
>
> You're getting the error because you haven't set a template in your
> action.
>
> usually default is for 404 errors only - something like:
>
> sub default : Private {
> my ($self, $c) = @_;
> $c->res->status(404);
> $c->res->body('404 not found');
> # or maybe $c->stash->{template} = '404.tt'
> }
>
Is it generally good practice to not put index like pages in default and
instead have an error message? I can see that being useful when your default
home page shows up in an ajax call. I guess this maybe why there are now
index functions.
Thanks for the comments.
mojo
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/