Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Render Status 404 not working from Other file route
- # app.pl
- use Mojolicious::Lite;
- app->route('search/:by')->to('search#index');
- app->start;
- package Search;
- sub index {
- my $self = shift;
- my $by = $self->param('by');
- if ( $by eq 'model' ) { $text = "by model" }
- elsif ( $by eq 'price' ) { $text = "by price" }
- else { return $self->render( status => 404 ) }
- $self->render( text => $text );
- }
- =cut Log
- [Thu Jan 26 09:47:32 2012] [debug] GET /search/test (Mozilla/5.0 (X11; Linux x86_64) AppleWebKi35.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7).
- [Thu Jan 26 09:47:32 2012] [debug] Dispatching "Search->index".
- [Thu Jan 26 09:47:32 2012] [debug] Template "search/index.html.ep" not found.
- [Thu Jan 26 09:47:32 2012] [debug] Template "search/index.html.ep" not found.
- [Thu Jan 26 09:47:32 2012] [debug] Nothing has been rendered, assuming delayed response.
- [Thu Jan 26 09:47:47 2012] [error] Connection timeout.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement