Permalink
Browse files

Updated to WebNano 0.007

  • Loading branch information...
1 parent aaae411 commit e5aeba0263fcd8e4cc52470214e02d2229a0921a Zbigniew Lukasiak committed May 19, 2012
Showing with 9 additions and 4 deletions.
  1. +3 −1 lib/Nblog/Controller.pm
  2. +3 −1 lib/Nblog/Controller/Admin.pm
  3. +3 −2 lib/Nblog/Controller/Article.pm
View
@@ -3,7 +3,9 @@ use warnings;
package Nblog::Controller;
-use base 'WebNano::DirController';
+use base 'WebNano::Controller';
+
+sub search_subcontrollers { 1 }
sub index_action {
my $self = shift;
@@ -6,7 +6,9 @@ use Moose;
use MooseX::NonMoose;
use Plack::Response;
-extends 'WebNano::DirController';
+extends 'WebNano::Controller';
+
+sub search_subcontrollers { 1 }
around 'local_dispatch' => sub {
my $orig = shift;
@@ -13,14 +13,15 @@ use Nblog::Form::Comment;
has article => ( is => 'rw' );
around local_dispatch => sub {
- my ( $orig, $self, $title, @args ) = @_;
+ my ( $orig, $self, ) = @_;
+ my $title = shift @{ $self->path };
$title = uri_unescape( $title );
my $app = $self->app;
my $article = $app->schema->resultset('Article')
->search( { 'subject' => { like => $app->ravlog_url_to_query($title) } } )->first;
if( $article ){
$self->article( $article );
- $self->$orig( @args );
+ $self->$orig();
}
else{
my $res = Plack::Response->new(404);

0 comments on commit e5aeba0

Please sign in to comment.