Changeset 4 for trunk/Vote


Ignore:
Timestamp:
03/05/09 23:03:16 (15 years ago)
Author:
nanardon
Message:
  • start vote form
Location:
trunk/Vote
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Vote/lib/Vote/Controller/Ballot.pm

    r3 r4  
    2222=cut 
    2323 
    24 sub index : Private { 
    25     my ( $self, $c ) = @_; 
     24sub default : Private { 
     25    my ( $self, $c, undef, $id ) = @_; 
    2626 
    27     $c->response->body('Matched Vote::Controller::Ballot in Ballot.'); 
     27    $c->stash->{voteid} = $id; 
    2828} 
    2929 
  • trunk/Vote/lib/Vote/Model/Vote.pm

    r3 r4  
    110110} 
    111111 
     112sub vote_choices { 
     113    my ($self, $id) = @_; 
     114 
     115    my $sth = $self->db->prepare_cached( 
     116        q{ 
     117        select * from choice where poll = ? 
     118        order by label 
     119        } 
     120    ); 
     121    $sth->execute($id); 
     122    my @ch; 
     123    while (my $res = $sth->fetchrow_hashref) { 
     124        push(@ch, $res); 
     125    } 
     126    @ch 
     127} 
     128 
    112129=head1 AUTHOR 
    113130 
Note: See TracChangeset for help on using the changeset viewer.