Last change
on this file since 74 was
53,
checked in by nanardon, 15 years ago
|
- rollback database before doing anything
|
File size:
769 bytes
|
Line | |
---|
1 | package Vote::Controller::Vote; |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | use base 'Catalyst::Controller'; |
---|
6 | |
---|
7 | =head1 NAME |
---|
8 | |
---|
9 | Vote::Controller::Vote - Catalyst Controller |
---|
10 | |
---|
11 | =head1 DESCRIPTION |
---|
12 | |
---|
13 | Catalyst Controller. |
---|
14 | |
---|
15 | =head1 METHODS |
---|
16 | |
---|
17 | =cut |
---|
18 | |
---|
19 | |
---|
20 | =head2 index |
---|
21 | |
---|
22 | =cut |
---|
23 | |
---|
24 | sub begin : Private { |
---|
25 | my ( $self, $c ) = @_; |
---|
26 | $c->model('Vote')->db->rollback; |
---|
27 | } |
---|
28 | |
---|
29 | sub index : Private { |
---|
30 | my ( $self, $c ) = @_; |
---|
31 | |
---|
32 | $c->redirect($c->uri_for('/')); |
---|
33 | } |
---|
34 | |
---|
35 | sub default : LocalPath { |
---|
36 | my ( $self, $c, undef, $id ) = @_; |
---|
37 | |
---|
38 | $c->stash->{voteid} = $id; |
---|
39 | $c->stash->{page}{title} = 'Vote: ' . $c->model('Vote')->vote_info($id)->{label}; |
---|
40 | } |
---|
41 | |
---|
42 | =head1 AUTHOR |
---|
43 | |
---|
44 | Thauvin Olivier |
---|
45 | |
---|
46 | =head1 LICENSE |
---|
47 | |
---|
48 | This library is free software, you can redistribute it and/or modify |
---|
49 | it under the same terms as Perl itself. |
---|
50 | |
---|
51 | =cut |
---|
52 | |
---|
53 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.