Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Problem with Catalyst Tutorial

by ColtsFoot (Chaplain)
on Feb 24, 2006 at 09:05 UTC ( #532496=perlquestion: print w/ replies, xml ) Need Help??
ColtsFoot has asked for the wisdom of the Perl Monks concerning the following question:

I am following Marcus Ramberg's Catalyst Tutorial on CPAN
and get the following error when implementing the login action
Caught exception in tutorial::Controller::Users->logon "Can't locate o +bject method "login" via package "tutorial" at /home/bric1/tutorial/s +cript/../lib/tutorial/Controller/Users.pm line 24."
I have the following "use" statements
use Catalyst qw/-Debug Static::Simple Authentication Authentication::Store::Minimal Authentication::Credential::Password/;
My login action code is as follows
sub login : Local { my ($self, $c) = @_; $c->stash->{template} = 'userlogin.tt'; if(!$c->login()) { $c->stash->{message} = 'Please login.'; } else { $c->stash->{message} = "Welcome " . $c->user->id; } }
Authentication::Credential::Password does have a "login" method
I would be gratefil for any pointers

Comment on Problem with Catalyst Tutorial
Select or Download Code
Re: Problem with Catalyst Tutorial
by castaway (Parson) on Feb 24, 2006 at 09:14 UTC
    Do you have that login sub in your tutorial.pm, or in a controller? (It should be in a controller) And is the "use Catalyst" in your tutorial.pm (It should be)? Do you get a Credential::Password listed in the list of loaded plugins when you start the test server?

    Also note that your error message says "logon" and your code says "login" which is it?

    C.

Re: Problem with Catalyst Tutorial
by ghenry (Vicar) on Feb 24, 2006 at 11:23 UTC

    Check out some of the Example Apps and read some of the Advent calender. It's all there ;-)

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://532496]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-07-24 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls