Vote::Controller::Vote - Catalyst Controller


Vote documentation Contained in the Vote distribution.

Index


Code Index:

NAME

Top

Vote::Controller::Vote - Catalyst Controller

DESCRIPTION

Top

Catalyst Controller.

METHODS

Top

index

AUTHOR

Top

Thauvin Olivier

LICENSE

Top

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself or CeCILL.


Vote documentation Contained in the Vote distribution.
package Vote::Controller::Vote;

use strict;
use warnings;
use base 'Catalyst::Controller';

sub begin : Private {
    my ( $self, $c ) = @_;
    $c->model('Vote')->db->rollback;
}

sub index : Private {
    my ( $self, $c ) = @_;

    $c->redirect($c->uri_for('/'));
}

sub default : LocalPath {
    my ( $self, $c, undef, $id ) = @_;

    $c->stash->{voteid} = $id;
    $c->stash->{page}{title} = 'Vote: ' . $c->model('Vote')->vote_info($id)->{label};
}

1;