change filter_response to response_filter in the places I got it wrong
[catagits/Web-Simple.git] / examples / bloggery / bloggery.cgi
index cef1f9b..947180f 100755 (executable)
@@ -1,3 +1,5 @@
+#!/usr/bin/perl
+
 use FindBin;
 use lib $FindBin::Bin.'/code';
 use Web::Simple 'Bloggery';
@@ -84,10 +86,10 @@ sub post {
 
 dispatch [
   sub (.html) {
-    filter_response { $self->render_html($_[1]) },
+    response_filter { $self->render_html($_[1]) },
   },
   sub (GET + /) {
-    $self->redispatch('index.html')
+    redispatch_to '/index.html';
   },
   sub (GET + /index) {
     $self->post_list
@@ -144,7 +146,7 @@ sub main_html_for {
   } elsif ($data->isa('Bloggery::PostList')) {
     <ul>,
       $data->map(sub {
-        my $path = '/'.$_->name.'.html';
+        my $path = $_->name.'.html';
         <li>,
           <h4>, <a href="$path">, $_->title, </a>, </h4>,
           <span class="summary">, $_->summary_html, </span>,