|
|
@ -6,7 +6,36 @@ use utf8; |
|
|
|
|
|
|
|
|
|
|
|
use Mojo::Base 'Mojolicious::Controller'; |
|
|
|
use Mojo::Base 'Mojolicious::Controller'; |
|
|
|
|
|
|
|
|
|
|
|
sub view { my ($self) = @_; $self->render(); } |
|
|
|
|
|
|
|
sub create { my ($self) = @_; $self->render(); } |
|
|
|
sub create { my ($self) = @_; $self->render(); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub view |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
my ($self) = @_; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$self->render(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub save |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
my ($self) = @_; |
|
|
|
|
|
|
|
my $id = $self->stash('id'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
eval { |
|
|
|
|
|
|
|
die("not implemented\n"); |
|
|
|
|
|
|
|
$self->redirect_to("/zerobin2/$id"); |
|
|
|
|
|
|
|
1; |
|
|
|
|
|
|
|
} or do { |
|
|
|
|
|
|
|
$self->stash({'result' => $@}); |
|
|
|
|
|
|
|
$self->redirect_to("/zerobin2/$id"); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$self->rendered(); |
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub prune |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$self->stash({'result' => $@}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
1; |
|
|
|
1; |
|
|
|