[dancer-users] How to send user on to another page/template?

Andrew Beverley andy at andybev.com
Wed Aug 19 00:47:18 BST 2015


On Tue, 2015-08-18 at 16:21 -0500, Richard Reina wrote:
> I am trying to learn dancer and have run across the following problem. In
> my starter app after a user logs in I want to send them to a welcome page.
> For now I am just trying to send them back to the index page. However, I am
> having problems doing so with the following syntax.
> 
> I get:
> Error 404 - Not Found
> /index

That means that you do not have a route that will handle /index, hence the 404.

> Am I going about this the wrong way or is redirect the way to go and if so
> what would be the proper syntax to make redirect work?
> 
> 
>           redirect '/index';

Yep, that's correct in terms of the redirect. If you want to go to the "index" of
your site (i.e. the root), then you probably want:

    redirect '/';

Regards,

Andy




More information about the dancer-users mailing list