Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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

Replies are listed 'Best First'.
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?
[erix]: you'll like the new postgres feature that I'm testing at the moment Corion: logical replication. You can then simply specify what objects to replicate (rather than necessarily the whole database, as is now the case)
[erix]: whole-database replication is nice but sometimes overkill

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-01-17 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (156 votes). Check out past polls.