-
-
Save hesco/69e45d4bdd7810db8173 to your computer and use it in GitHub Desktop.
I have routes to list, add and apply targets. They all are formed precisely the same way, except for the name differences. The list target works, the add and apply targets are failing. I have no idea why, but full details on the a failing Add target are provided below. Can someone please help me understand what I may be missing here? Thanks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ prove -lv t/routes.t -- | |
ok 7 - 200 OK | |
ok 8 - GET /VolunteerOpportunities/Add | |
not ok 9 - 200 OK | |
# Failed test '200 OK' | |
# at t/routes.t line 11. | |
# got: '404' | |
# expected: '200' | |
----- | |
$ less t/routes.t -- | |
$t->get_ok('/VolunteerOpportunities/Add')->status_is(200); | |
----- | |
$ less lib/VolunteerEngagement.pm -- | |
package VolunteerEngagement; | |
use Mojo::Base 'Mojolicious'; | |
# This method will run once at server start | |
sub startup { | |
my $self = shift; | |
# Documentation browser under "/perldoc" | |
$self->plugin('PODRenderer'); | |
# Router | |
my $r = $self->routes; | |
<snip> | |
# Authorized user adds new job listing | |
$r->post('/VolunteerOpportunities/Add')->to('volunteer_opportunities#add'); | |
<snip> | |
} | |
1; | |
----- | |
$ less lib/VolunteerEngagement/VolunteerOpportunities.pm -- | |
package VolunteerEngagement::VolunteerOpportunities; | |
use Mojo::Base 'Mojolicious::Controller'; | |
<snip> | |
sub add { | |
my $self = shift; | |
# Render template "volunteeropportunities/add.html.ep" with message | |
$self->render( | |
msg => 'Add new job description to list of available volunteer opportunities', | |
template => 'volunteer_opportunities/add', | |
); | |
} | |
<snip> | |
1; | |
----- | |
$ less templates/volunteer_opportunities/add.html.ep -- | |
% layout 'default'; | |
% title 'Welcome'; | |
<h2><%= $msg %></h2> | |
This page was generated from the template | |
"templates/example/welcome.html.ep" | |
and the layout "templates/layouts/default.html.ep", | |
<a href="<%== url_for %>">click here</a> to reload the page or | |
<a href="/index.html">here</a> to move forward to a static page. | |
----- | |
$ less log/development.log -- | |
[Wed Oct 9 15:01:56 2013] [debug] GET "/VolunteerOpportunities/Add". | |
[Wed Oct 9 15:01:56 2013] [debug] Template "not_found.development.html.ep" not found. | |
[Wed Oct 9 15:01:56 2013] [debug] Template "not_found.html.ep" not found. | |
[Wed Oct 9 15:01:56 2013] [debug] Rendering inline template. | |
[Wed Oct 9 15:01:56 2013] [debug] Rendering inline template. | |
[Wed Oct 9 15:01:56 2013] [debug] 404 Not Found (0.027269s, 36.672/s). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment