From 8c80309184e37f6b1ecec7de12ebbb231dac6523 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 26 Jul 2015 17:48:51 +0200 Subject: [PATCH] Mere get/post routes for the feedback form --- vroom.pl | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/vroom.pl b/vroom.pl index ccef298..5dbe8d0 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1479,17 +1479,14 @@ get '/documentation' => sub { ); } => 'documentation'; -# Routes for feedback. One get to display the form -# and one post to get data from it -get '/feedback' => sub { +# Route for feedback form +any [ qw(GET POST) ] => '/feedback' => sub { my $self = shift; - $self->stash( - page => 'feedback' - ); -} => 'feedback'; - -post '/feedback' => sub { - my $self = shift; + if ($self->req->method eq 'GET'){ + return $self->render('feedback', + page => 'feedback' + ); + } my $email = $self->param('email') || ''; my $comment = $self->param('comment'); my $sent = $self->mail(