I have changed default Mojolicious application in next way:
- Add route
/testintoMyApp.pm
# Normal route to controller
$r->get('/')->to('example#welcome');
+ $r->get('/test')->to('example#test');
}
- Add action
testand template intoMyApp::Controller::Example.pm
+
+sub test {
+ my $self = shift;
+
+ $self->render_maybe( 'not_existent1', foo => 1 );
+ $self->render_maybe( 'not_existent2', bar => 2 );
+ $self->render;
+}
+
+1;
+
+__DATA__
+@@ example/test.html.ep
+$foo $bar
- Then run:
./script/my_app get /test
The output is 1--2. This is not expected because I render template without any arguments.
I'm inclined to believe that this behavior is the bug.
If not tell me please how to prevent original stash while trying to render other templates?