[Catalyst] Can't detach from root / create action object

Craig Chant craig at homeloanpartnership.com
Wed Nov 27 12:36:54 GMT 2013


No the documentation isn't clear, if I could understand it I wouldn’t be asking this question.

What is $action ?  And yes I've looked at  the manual.

Chapter 3 when you search for 'detach' states..

NOTE: If you use the default template technique, you will not be able to use either the $c->forward or the $c->detach mechanisms (these are discussed in Chapter 2 and Chapter 9 of the Tutorial).

So I go back to chapter 2 and search for detach and get zero results the same when I search chapter 9?

Not sure why you seem to think the tutorial is clear, when I seem to be going round in circles?


-----Original Message-----
From: David Schmidt [mailto:davewood at gmx.at]
Sent: 27 November 2013 12:24
To: The elegant MVC web framework
Subject: Re: [Catalyst] Can't detach from root / create action object

You should tell us what you want to achieve.

"I want to pass an action to detach()" is not a proper problem description.


The documentation is pretty clear on what is expected.
https://metacpan.org/pod/Catalyst#c-detach-action-arguments

$c->detach( $action [, \@arguments ] )
$c->detach( $class, $method, [, \@arguments ] )
$c->detach()

Have you checked the Catalyst Tutorial. It should provide examples for detach() There is also the test suite which you can grep for detach.





On 27 November 2013 13:00, Craig Chant <craig at homeloanpartnership.com> wrote:
> I seem to be going round in circles unable to understand how I create
> an action object so I can pass it to detach as the IRC has told me to
> pass in an action and not what I thought which was ‘controller_name, subroutine’.
>
>
>
> E.G.
>
>
>
> $c->detach(‘my_controller_name’,’index’);
>
>
>
> But it seems that this signature is  (‘class_name’, ‘subroutine’)
>
>
>
> I’m having a problem with Catalyst randomly deciding when it is OK to
> have a controller and a model called the same, as I have in the same
> root auto subroutine ,
>
>
>
> $c->detach(‘splashscreen’,’index’).
>
>
>
> Where I have both a controller called ‘SplashScreen’ and a model
> called ‘SplashScreen’, and the detach works fine.
>
>
>
> However, for another controller / model pair called
> ‘ComplianceUpdates’,
>
>
>
> This doesn’t work
>
>
>
> $c->detach(‘complianceupdates’,’index’).
>
>
>
> and errors with…
>
> Couldn't forward to "ComplianceUpdates". Does not implement "process"
>
> Couldn't detach to command "complianceupdates": Invalid action or component.
>
> So If I am to use
>
>
>
> $c->detach($action);
>
>
>
> How do I create a Catalyst::Action object.
>
>
>
> What attributes am I meant to be setting in the object before I pass
> it in, and where are the docs for this as I can’t find them.
>
>
>
> All help is appreciated.
>
>
>
>
>
> Craig Chant
>
> Information Technology Manager
>
>
>
>
>
>   Direct Line: 01903 227 753       Main Line: 01903 602 664       Website:
> www.homeloanpartnership.com
>
>
>
>
>
> This Email and any attachments contain confidential information and is
> intended solely for the individual to whom it is addressed. If this
> Email has been misdirected, please notify the author as soon as
> possible. If you are not the intended recipient you must not disclose,
> distribute, copy, print or rely on any of the information contained,
> and all copies must be deleted immediately. Whilst we take reasonable
> steps to try to identify any software viruses, any attachments to this
> e-mail may nevertheless contain viruses, which our anti-virus software
> has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents.
> HomeLoan Partnership will not accept any liability for damage caused
> by computer viruses emanating from any attachment or other document
> supplied with this e-mail. HomeLoan Partnership reserves the right to
> monitor and archive all e-mail communications through its network. No
> representative or employee of HomeLoan Partnership has the authority
> to enter into any contract on behalf of HomeLoan Partnership by email.
> HomeLoan Partnership is a trading name of H L Partnership Limited,
> registered in England and Wales with Registration Number 5011722.
> Registered office: Pharos House, 67 High Street, Worthing, West
> Sussex, BN11 1DN. H L Partnership Limited is authorised and regulated by the Financial Conduct Authority.
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
This Email and any attachments contain confidential information and is intended solely for the individual to whom it is addressed. If this Email has been misdirected, please notify the author as soon as possible. If you are not the intended recipient you must not disclose, distribute, copy, print or rely on any of the information contained, and all copies must be deleted immediately. Whilst we take reasonable steps to try to identify any software viruses, any attachments to this e-mail may nevertheless contain viruses, which our anti-virus software has failed to identify. You should therefore carry out your own anti-virus checks before opening any documents. HomeLoan Partnership will not accept any liability for damage caused by computer viruses emanating from any attachment or other document supplied with this e-mail. HomeLoan Partnership reserves the right to monitor and archive all e-mail communications through its network. No representative or employee of HomeLoan Partnership has the authority to enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan Partnership is a trading name of H L Partnership Limited, registered in England and Wales with Registration Number 5011722. Registered office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L Partnership Limited is authorised and regulated by the Financial Conduct Authority.


More information about the Catalyst mailing list